diff --git a/settings.json.example b/settings.json.example index ee71266..0392a02 100644 --- a/settings.json.example +++ b/settings.json.example @@ -12,6 +12,7 @@ "pg_db": "rcgcdb", "pg_pass": "secret_password", "pg_port": "5432", + "discussions_enabled": false, "irc_servers": { "your custom name for the farm": { "domains": ["wikipedia.org", "otherwikipedia.org"], diff --git a/src/bot.py b/src/bot.py index dab521a..83745fb 100644 --- a/src/bot.py +++ b/src/bot.py @@ -403,6 +403,8 @@ async def message_sender(): async def discussion_handler(): await asyncio.sleep(3.0) # Make some time before IRC code is executed, happens only once and saves if inside + if not settings.get("discussions_enabled", False): + raise asyncio.CancelledError try: while True: async with db.pool().acquire() as connection: