Add a `forget` command to remove a channel from monitoring

This commit is contained in:
Adam Goldsmith 2021-05-03 00:42:39 -04:00
parent 196d69da51
commit 344c65398c
1 changed files with 8 additions and 0 deletions

View File

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