Add a refresh command.

This commit is contained in:
2024-05-15 14:07:27 -04:00
parent cf5b5f8068
commit 52ee85f17c
2 changed files with 34 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
"""
Contained commands and views for refresh commands.
"""
import nextcord
from nextcord.ext import commands
from utils import update_clan_messages
class RefreshCog(commands.Cog, name="Refresh Commands"):
"""
Class holds refresh commands.
"""
@nextcord.slash_command(
default_member_permissions=nextcord.Permissions(administrator=True)
)
async def refresh(self, interaction: nextcord.Interaction):
"""
Parent slash command for refresh. Never called.
"""
@refresh.subcommand(description="Force refresh all of the bot managed messages.")
async def event(self, interaction: nextcord.Interaction):
"""
Calls update_clan_messages() to update all messages.
Args:
interaction (nextcord.Interaction): Interaction with the command.
"""
await update_clan_messages(interaction.guild)