Add adbupdate command to force an update without sending a message
This commit is contained in:
parent
2684d6083b
commit
c429278cc8
17
ahtcg_bot.py
17
ahtcg_bot.py
@ -48,6 +48,23 @@ class ArkhamDBUpdater(discord.Client):
|
|||||||
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()
|
||||||
|
@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()
|
@tree.command()
|
||||||
async def adbforget(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"""
|
||||||
|
Loading…
Reference in New Issue
Block a user