Skip to content

Commit

Permalink
fix(sync): defer syncing message
Browse files Browse the repository at this point in the history
  • Loading branch information
Pukimaa committed Oct 1, 2023
1 parent c08cec3 commit 7b49b0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cogs/owner/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ def __init__(self, bot: TakoBot):
@commands.hybrid_command(description="Sync all slash commands")
@commands.is_owner()
async def sync(self, ctx):
await ctx.defer(ephemeral=True)
if hasattr(bot_secrets, "TEST_GUILD"):
self.bot.tree.copy_global_to(
guild=discord.Object(id=bot_secrets.TEST_GUILD) # type: ignore
)
await self.bot.tree.sync(guild=discord.Object(id=bot_secrets.TEST_GUILD)) # type: ignore
else:
await self.bot.tree.sync()
await ctx.reply("Successfully synced!", ephemeral=True)
await ctx.followup.send("Successfully synced!", ephemeral=True)

@sync.error
async def on_command_error(
Expand Down

0 comments on commit 7b49b0e

Please sign in to comment.