UserCommand
A class that implements the protocol for user context menu commands. These commands appear when right-clicking on a user.Attributes
The name of the command.
The coroutine that is executed when the command is called. Must accept
ctx and user parameters.The ids of the guilds where this command will be registered.
Whether the command should be restricted to 18+ channels and users. Apps intending to be listed in the App Directory cannot have NSFW commands.
The default permissions a member needs to be able to run the command.
The cog that this command belongs to.
None if there isn’t one.A list of predicates that verifies if the command could be executed with the given ApplicationContext as the sole parameter.
The cooldown applied when the command is invoked.
None if the command doesn’t have a cooldown.The name localizations for this command. The values of this should be
"locale": "name". See Discord’s locales documentation for valid locales.The installation contexts where this command is available. Unapplicable for guild commands.
The interaction contexts where this command is available. Unapplicable for guild commands.
Methods
copy()
Creates a copy of this command. Returns:UserCommand - A new instance of this command.
MessageCommand
A class that implements the protocol for message context menu commands. These commands appear when right-clicking on a message.Attributes
The name of the command.
The coroutine that is executed when the command is called. Must accept
ctx and message parameters.The ids of the guilds where this command will be registered.
Whether the command should be restricted to 18+ channels and users. Apps intending to be listed in the App Directory cannot have NSFW commands.
The default permissions a member needs to be able to run the command.
The cog that this command belongs to.
None if there isn’t one.A list of predicates that verifies if the command could be executed with the given ApplicationContext as the sole parameter.
The cooldown applied when the command is invoked.
None if the command doesn’t have a cooldown.The name localizations for this command. The values of this should be
"locale": "name". See Discord’s locales documentation for valid locales.The installation contexts where this command is available. Unapplicable for guild commands.
The interaction contexts where this command is available. Unapplicable for guild commands.
Methods
copy()
Creates a copy of this command. Returns:MessageCommand - A new instance of this command.
user_command()
Decorator for creating user context menu commands.The name of the command. Defaults to the function name.
A list of guild IDs where this command will be registered. If not provided, the command is global.
The default permissions required to use this command.
Whether the command is age-restricted.
The contexts where this command can be used.
The installation types this command is available for.
Callable[..., UserCommand] - A decorator that converts the provided method into a UserCommand.
message_command()
Decorator for creating message context menu commands.The name of the command. Defaults to the function name.
A list of guild IDs where this command will be registered. If not provided, the command is global.
The default permissions required to use this command.
Whether the command is age-restricted.
The contexts where this command can be used.
The installation types this command is available for.
Callable[..., MessageCommand] - A decorator that converts the provided method into a MessageCommand.
