Add option to disable discussions

This commit is contained in:
Frisk 2023-08-20 19:09:19 +02:00
parent 9348c36355
commit 508640cfba
2 changed files with 3 additions and 0 deletions

View file

@ -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"],

View file

@ -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: