-
Hey, Hope my problem is understandable so far. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 23 replies
-
You can call This means to make your command available dynamically you can go multiple routes: The @commands.hybrid_command()
@app_commands.guilds()
async def example(context: commands.Context) -> None:
...
# Somewhere before syncing the tree
bot.tree.add_command(example.app_command, guilds=...) You can also simply register your command as a global command, but before you sync the tree you remove it and add it for the guilds it should be in: @commands.hybrid_command()
async def example(context: commands.Context) -> None:
...
# Somewhere before syncing the tree
bot.tree.remove_command('example')
bot.tree.add_command(example.app_command, guilds=...) |
Beta Was this translation helpful? Give feedback.
You can call
CommandTree.add_command
/CommandTree.remove_command
and then sync the tree for the guild(s) you added / removed the command to at any point, allowing you to change where commands are available on the fly.This means to make your command available dynamically you can go multiple routes:
The
@guilds
decorator can be used without passing in any guilds, allowing you to specify which guilds the command is for later before syncing:You can also simply register your command as a glob…