diff options
author | Parker <contact@pkrm.dev> | 2024-07-12 03:06:00 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-07-12 03:06:00 -0500 |
commit | dfc95e470cf73a560e1a4c2cd6b6f1386b780c73 (patch) | |
tree | b19e8f7a7b791dfad4ed512215bf4742740f7918 /code/cogs/owner/tree_sync.py | |
parent | 0cd223c3a52ae630610a5ec99f02df94587fbed8 (diff) |
Overhaul `sync` command
Diffstat (limited to 'code/cogs/owner/tree_sync.py')
-rw-r--r-- | code/cogs/owner/tree_sync.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/code/cogs/owner/tree_sync.py b/code/cogs/owner/tree_sync.py deleted file mode 100644 index 5050730..0000000 --- a/code/cogs/owner/tree_sync.py +++ /dev/null @@ -1,33 +0,0 @@ -from discord.ext import commands -from discord import Object - - -class TreeSync(commands.Cog): - def __init__(self, bot): - self.bot = bot - - @commands.command() - @commands.dm_only() - @commands.is_owner() - async def sync(self, ctx: commands.Context, *, guild: Object = None) -> None: - if not guild or guild == None: - await self.bot.tree.sync() - await ctx.author.send("Synced commands globally") - return - - elif guild != None: - self.bot.tree.copy_global_to(guild=guild) - await self.bot.tree.sync(guild=guild) - - await ctx.author.send(f"Synced the tree to 1 test guild.") - - @sync.error - async def error_sync(self, ctx, error): - if isinstance(error, commands.errors.PrivateMessageOnly): - pass - else: - await ctx.author.send("That is not a valid guild ID") - - -async def setup(bot): - await bot.add_cog(TreeSync(bot)) |