Use less generic command names and call correct methods for new discord.py
This commit is contained in:
parent
7d9f31ab6d
commit
7dadef6911
22
ahtcg_bot.py
22
ahtcg_bot.py
@ -40,22 +40,26 @@ class ArkhamDBUpdater(discord.Client):
|
|||||||
tree = app_commands.CommandTree(self)
|
tree = app_commands.CommandTree(self)
|
||||||
|
|
||||||
@tree.command()
|
@tree.command()
|
||||||
async def monitor(interaction: discord.Interaction) -> None:
|
async def adbmonitor(interaction: discord.Interaction) -> None:
|
||||||
"""Watch this channel for deck links and link to latest versions."""
|
"""Watch this channel for deck links and link to latest versions"""
|
||||||
await interaction.message.reply(
|
await interaction.response.send_message(
|
||||||
"Now monitoring this channel for deck IDs", mention_author=True
|
"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:
|
with open(self.channel_list_file, "w") as f:
|
||||||
json.dump(list(self.channel_list), f)
|
json.dump(list(self.channel_list), f)
|
||||||
|
|
||||||
@tree.command()
|
@tree.command()
|
||||||
async def forget(interaction: discord.Interaction) -> None:
|
async def adbforget(interaction: discord.Interaction) -> None:
|
||||||
"""Remove this channel from the monitor list"""
|
"""Remove this channel from the monitor list"""
|
||||||
await interaction.message.reply(
|
await interaction.response.send_message(
|
||||||
"No longer monitoring this channel for deck IDs", mention_author=True
|
"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:
|
with open(self.channel_list_file, "w") as f:
|
||||||
json.dump(list(self.channel_list), f)
|
json.dump(list(self.channel_list), f)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user