From 7dadef6911797b6b09696b7c7c97348b4d598f14 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 4 Jun 2022 22:15:58 -0400 Subject: [PATCH] Use less generic command names and call correct methods for new discord.py --- ahtcg_bot.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/ahtcg_bot.py b/ahtcg_bot.py index b6a6f33..ec2cdae 100755 --- a/ahtcg_bot.py +++ b/ahtcg_bot.py @@ -40,22 +40,26 @@ class ArkhamDBUpdater(discord.Client): tree = app_commands.CommandTree(self) @tree.command() - async def monitor(interaction: discord.Interaction) -> None: - """Watch this channel for deck links and link to latest versions.""" - await interaction.message.reply( - "Now monitoring this channel for deck IDs", mention_author=True + async def adbmonitor(interaction: discord.Interaction) -> None: + """Watch this channel for deck links and link to latest versions""" + await interaction.response.send_message( + "Now monitoring this channel for deck IDs", ephemeral=True ) - self.channel_list.add(interaction.message.channel.id) + logging.info(f"Now monitoring: {self.get_channel(interaction.channel_id)}") + self.channel_list.add(interaction.channel_id) with open(self.channel_list_file, "w") as f: json.dump(list(self.channel_list), f) @tree.command() - async def forget(interaction: discord.Interaction) -> None: + async def adbforget(interaction: discord.Interaction) -> None: """Remove this channel from the monitor list""" - await interaction.message.reply( - "No longer monitoring this channel for deck IDs", mention_author=True + await interaction.response.send_message( + "No longer monitoring this channel for deck IDs", ephemeral=True ) - self.channel_list.discard(interaction.message.channel.id) + logging.info( + f"Stopped monitoring: {self.get_channel(interaction.channel_id)}" + ) + self.channel_list.discard(interaction.channel_id) with open(self.channel_list_file, "w") as f: json.dump(list(self.channel_list), f)