Files
dakiny-bot/cogs/commands/refresh.py
T
imcompiling f822ed2e2d
build_develop / build (push) Failing after 19s
Correct sub command name. Add response.
2024-05-15 14:17:27 -04:00

36 lines
1018 B
Python

"""
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 messages(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)
await interaction.response.send_message(
"Messages have been refreshed.", ephemeral=True
)