From 81920ea11057c291702c361c3281097c00dad423 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Mon, 11 Nov 2024 18:08:41 -0800 Subject: [PATCH] update --- discord-bot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/discord-bot.py b/discord-bot.py index 00f397e..a27c066 100644 --- a/discord-bot.py +++ b/discord-bot.py @@ -49,8 +49,14 @@ def __init__(self): async def setup_hook(self): # This is called when the bot starts up + # Sync commands with all guilds the bot is in + for guild in self.guilds: + self.tree.copy_global_to(guild=guild) + await self.tree.sync(guild=guild) + logger.info(f"Synced commands for guild: {guild.name}") + # Also sync globally await self.tree.sync() - logger.info("Slash commands synced") + logger.info("Slash commands synced globally") client = ClusterBot()