Skip to content

Commit

Permalink
refact(admin): also sync global beta commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ZRunner committed Jul 18, 2024
1 parent 13b0ce6 commit b15dbd0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions modules/admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,8 @@ async def sync_app_commands(self, interaction: discord.Interaction,
"Sync app commands for either global or staff server scope"
await interaction.response.defer()
if scope == "global":
if self.bot.beta:
for guild_id in (PRIVATE_GUILD_ID, SUPPORT_GUILD_ID):
self.bot.tree.copy_global_to(guild=guild_id)
cmds = await self.bot.tree.sync(guild=guild_id)
txt = f"{len(cmds)} (global + local) app commands synced in support and staff servers"
else:
cmds = await self.bot.tree.sync()
txt = f"{len(cmds)} global app commands synced"
cmds = await self.bot.tree.sync()
txt = f"{len(cmds)} global app commands synced"
elif scope == "staff-server":
cmds = await self.bot.tree.sync(guild=PRIVATE_GUILD_ID)
txt = f"{len(cmds)} app commands synced in the staff server"
Expand Down

0 comments on commit b15dbd0

Please sign in to comment.