Skip to content
Discussion options

You must be logged in to vote

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:

@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 glob…

Replies: 1 comment 23 replies

Comment options

You must be logged in to vote
23 replies
@Kadethra
Comment options

@LostLuma
Comment options

@Kadethra
Comment options

@LostLuma
Comment options

@Kadethra
Comment options

Answer selected by Kadethra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants