Use less generic command names and call correct methods for new discord.py

This commit is contained in:
Adam Goldsmith 2022-06-04 22:15:58 -04:00
parent 7d9f31ab6d
commit 7dadef6911
1 changed files with 13 additions and 9 deletions

View File

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