Skip to content
Discussion options

You must be logged in to vote

Hybrid Commands

The ext.commands extension provides a feature called "Hybrid Commands" that allow you to define a command that doubles as both a prefix command as well as an application (slash) command.

Defining hybrid commands

Similar to the @command decorator, In order to define a hybrid command, you can use the @hybrid_command decorator. Example:

@bot.hybrid_command()
async def hello(ctx, member: discord.Member):
  await ctx.send(f"Hello {member}")

Now this command works as both a text command as well as a slash command. In order for this to appear as slash command, you should sync your command tree using bot.tree.sync() function.

Documentation

The documentation for hybrid commands is h…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by IIDarkNessYT
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants