From 344c65398c83ab52f6b62f8943b6f53e714dec7d Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 3 May 2021 00:42:39 -0400 Subject: [PATCH] Add a `forget` command to remove a channel from monitoring --- ahtcg_bot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ahtcg_bot.py b/ahtcg_bot.py index 2b86c72..da5c7a8 100755 --- a/ahtcg_bot.py +++ b/ahtcg_bot.py @@ -34,6 +34,14 @@ class ArkhamDBUpdater(commands.Bot): with open('channel_list.json', 'w') as f: json.dump(list(self.channel_list), f) + @self.command(name='forget') + async def forget(ctx: commands.Context): + """Remove this channel from the monitor list""" + await ctx.message.reply('No longer monitoring this channel for deck IDs', mention_author=True) + self.channel_list.discard(ctx.message.channel.id) + with open('channel_list.json', 'w') as f: + json.dump(list(self.channel_list), f) + async def on_ready(self): print(f'Logged in as {self.user} (ID: {self.user.id})') print('Enabled on servers:')