Application CommandsΒΆ
You may have heard of them by names like _slash-commands_, _message-commands_ or _user-commands_. Application commands are commands that an application can register to Discord. They provide users a first-class way of interacting directly with your application that feels deeply integrated into Discord.
These are definied by attaching a _decorator_ to a regular Python function and passing the type of the application command to the decorator.
For example, in the given application command definition
@bot.application_command(discord.SlashCommand)
async def foo(ctx, arg: str):
await ctx.send(arg)
would be invoked by the user with
/foo abc