Message command
MessageCommand
#
Bases: ContextMenuCommand
Represents an application command for message's context menu.
Parameters:
-
name(str) –The unique name of the command.
-
display_name(LocalizedOr[str] | None, default:None) –A display name of command. Can be localized.
-
guild(SnowflakeishOr[PartialGuild] | UndefinedType, default:UNDEFINED) –Optional guild (server) where the command is available.
-
default_member_permissions(Permissions, default:Permissions.NONE) –The permissions a user must have to use the command by default.
-
is_dm_enabled(bool, default:False) –Whether the command can be used in direct messages.
-
is_nsfw(bool, default:False) –Indicates whether the command is age-restricted.
Example
callback
async
#
callback(context: InteractionContext, message: Message) -> None
A callback of the command.
Meant to override this method to set the callback to the command.
Raises:
-
NotImplementedError–If callback wasn't overrided.