Update owner.py
This commit is contained in:
parent
53f789844f
commit
183af68164
@ -94,7 +94,7 @@ class Owner(commands.Cog):
|
||||
|
||||
@commands.command()
|
||||
@commands.is_owner()
|
||||
async def sync(self, ctx: Context, guilds: Greedy[Object], spec: Optional[Literal['~', "*"]] = None) -> None:
|
||||
async def sync(self, ctx: Context, guilds: Greedy[Object], spec: Optional[Literal['~', "*", '!']] = None) -> None:
|
||||
"""
|
||||
!sync -> global sync
|
||||
!sync ~ -> sync current guild
|
||||
@ -107,6 +107,10 @@ class Owner(commands.Cog):
|
||||
elif spec == "*":
|
||||
ctx.bot.tree.copy_global_to(guild=ctx.guild)
|
||||
fmt = await ctx.bot.tree.sync(guild=ctx.guild)
|
||||
elif spec == '!':
|
||||
ctx.bot.tree.clear_commands(guild=ctx.guild)
|
||||
await ctx.send(f'Cleared all local commands.')
|
||||
fmt = await ctx.bot.tree.sync(guild=ctx.guild)
|
||||
else:
|
||||
fmt = await ctx.bot.tree.sync()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user