From a3fa3efb54a670b7527151cb55dae87bbc650e62 Mon Sep 17 00:00:00 2001 From: Choco <94597336+ChocoMeow@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:59:08 +0800 Subject: [PATCH] Added sync function in debug view --- views/debug.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/views/debug.py b/views/debug.py index b7120b8..d70fd55 100644 --- a/views/debug.py +++ b/views/debug.py @@ -177,6 +177,12 @@ class DebugView(discord.ui.View): async def run_command(self, interaction: discord.Interaction, button: discord.ui.Button): await self.panel.execute(interaction) - @discord.ui.button(label='Cogs', emoji="🔃") + @discord.ui.button(label='Cogs', emoji="⚙️") async def reload_cog(self, interaction: discord.Interaction, button: discord.ui.Button): - return await interaction.response.send_message("Reload Cogs", view=CogsView(self.bot), ephemeral=True) \ No newline at end of file + return await interaction.response.send_message("Reload Cogs", view=CogsView(self.bot), ephemeral=True) + + @discord.ui.button(label="Re-Sync", emoji="🔄") + async def sync(self, interaction: discord.Interaction, button: discord.ui.Button): + await interaction.response.send_message(content="🔄 Synchronizing all your commands and language settings!") + await self.bot.tree.sync() + await interaction.edit_original_response(content="✅ All commands and settings have been successfully synchronized!")