Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim committed Nov 12, 2024
1 parent c5e3900 commit 81920ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion discord-bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 81920ea

Please sign in to comment.