Add adbupdate command to force an update without sending a message

This commit is contained in:
Adam Goldsmith 2022-06-04 22:39:16 -04:00
parent 2684d6083b
commit c429278cc8
1 changed files with 17 additions and 0 deletions

View File

@ -48,6 +48,23 @@ class ArkhamDBUpdater(discord.Client):
with open(self.channel_list_file, "w") as f:
json.dump(list(self.channel_list), f)
@tree.command()
@app_commands.checks.cooldown(2, 60 * 5, key=lambda i: i.guild.id)
async def adbupdate(interaction: discord.Interaction) -> None:
"""Immediately update the deck summary"""
await interaction.response.defer(ephemeral=True, thinking=True)
await self.update_channel_latest_decks(
self.get_channel(interaction.channel_id)
)
await interaction.followup.send("Done with update!", ephemeral=True)
@adbupdate.error
async def on_adbupdate_error(
interaction: discord.Interaction, error: app_commands.AppCommandError
):
if isinstance(error, app_commands.CommandOnCooldown):
await interaction.response.send_message(str(error), ephemeral=True)
@tree.command()
async def adbforget(interaction: discord.Interaction) -> None:
"""Remove this channel from the monitor list"""