Sub command
SubCommand
#
sub_command
#
sub_command(name: str, *, display_name: LocalizedOr[str] | None = None, description: LocalizedOr[str] = 'No description', options: Sequence[Option] = ()) -> Callable[..., None]
Decorator for the sub-command.
This object can only be created by using the decorator @sub_command on a function in a class that inherits from SlashCommand.
Parameters:
-
name
(str
) –The unique name for the sub-command.
-
description
(LocalizedOr[str] | None
, default:'No description'
) –Optional description for the sub-command.
-
display_name
(LocalizedOr[str] | None
, default:None
) –A display name of command. Can be localized.
-
options
(Sequence[Option]
, default:()
) –Optional options of the sub-command.
Note
The callback must be asynchronous.