Options#
AttachmentOption
#
Bases: CommandOptionBase[Attachment, ClientT, AttachmentParams]
A slash command option that represents an attachment.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
AttachmentParams
#
AttachmentParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[Attachment]
The parameters for an attachment option.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
description_localizations
property
#
The description of the option in different locales.
BoolOption
#
Bases: CommandOptionBase[bool, ClientT, BoolParams]
A slash command option that represents a bool.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
BoolParams
#
BoolParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[bool]
The parameters for a bool option.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The localizations for the name of the option |
description_localizations |
The localizations for the description of the option |
description_localizations
property
#
The description of the option in different locales.
ChannelOption
#
Bases: CommandOptionBase[PartialChannel, ClientT, ChannelParams]
A slash command option that represents a channel.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
Note: The type of the channel determines the channel types that this option can be used with.
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
channel_types
class-attribute
instance-attribute
#
channel_types: Sequence[ChannelType] | None = None
The channel types that the option can be.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
ChannelParams
#
ChannelParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[PartialChannel]
The parameters for a channel option. The channel types are inferred from the type hint.
Example
An option of type hikari.TextableGuildChannel
will resolve to hikari.ChannelType.GUILD_PUBLIC_THREAD |
hikari.ChannelType.GUILD_PRIVATE_THREAD |
hikari.ChannelType.GUILD_NEWS_THREAD
.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
description_localizations
property
#
The description of the option in different locales.
ColorOption
#
Bases: ConverterOption[Color, ClientT, ColorParams, str]
A slash command option that represents a color.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
ColorParams
#
ColorParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[Color]
The parameters for a color option.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
description_localizations
property
#
The description of the option in different locales.
EmojiOption
#
Bases: ConverterOption[Emoji, ClientT, EmojiParams, str]
A slash command option that represents an emoji.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
EmojiParams
#
EmojiParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[Color]
The parameters for an emoji option.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
description_localizations
property
#
The description of the option in different locales.
FloatOption
#
Bases: OptionWithChoices[float, ClientT, FloatParams[ClientT]]
A slash command option that represents a float.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
autocomplete_with
class-attribute
instance-attribute
#
The callback for autocompleting the option.
choices
class-attribute
instance-attribute
#
choices: Sequence[ChoiceT | CommandChoice] | Mapping[str, ChoiceT] | None = None
The choices for the option.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
FloatParams
#
FloatParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] = {},
description_localizations: Mapping[Locale, str] = {},
min: float | None = None,
max: float | None = None,
choices: (
Sequence[float | CommandChoice] | Mapping[str, float] | None
) = None,
autocomplete_with: AutocompleteCallbackT[ClientT, float] | None = None
)
Bases: OptionWithChoicesParams[float, ClientT]
The parameters for a float option.
Warning
You cannot provide both choices
and autocomplete_with
at the same time.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
min |
The minimum value of the option
TYPE:
|
max |
The maximum value of the option
TYPE:
|
choices |
The choices for the option. If provided, these will be the only valid values for the option.
TYPE:
|
autocomplete_with |
The callback that is invoked when the user autocompletes the option
TYPE:
|
autocomplete_with
property
#
The callback for autocompleting the option.
choices
property
#
choices: Sequence[ChoiceT | CommandChoice] | Mapping[str, ChoiceT] | None
The choices for the option. If provided, these will be the only valid values for the option.
description_localizations
property
#
The description of the option in different locales.
IntOption
#
Bases: OptionWithChoices[int, ClientT, IntParams[ClientT]]
A slash command option that represents an int.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
autocomplete_with
class-attribute
instance-attribute
#
The callback for autocompleting the option.
choices
class-attribute
instance-attribute
#
choices: Sequence[ChoiceT | CommandChoice] | Mapping[str, ChoiceT] | None = None
The choices for the option.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
IntParams
#
IntParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None,
min: int | None = None,
max: int | None = None,
choices: Sequence[int | CommandChoice] | Mapping[str, int] | None = None,
autocomplete_with: AutocompleteCallbackT[ClientT, int] | None = None
)
Bases: OptionWithChoicesParams[int, ClientT]
The parameters for an int option.
Warning
You cannot provide both choices
and autocomplete_with
at the same time.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
min |
The minimum value of the option
TYPE:
|
max |
The maximum value of the option
TYPE:
|
choices |
The choices for the option. If provided, these will be the only valid values for the option.
TYPE:
|
autocomplete_with |
The callback that is invoked when the user autocompletes the option
TYPE:
|
autocomplete_with
property
#
The callback for autocompleting the option.
choices
property
#
choices: Sequence[ChoiceT | CommandChoice] | Mapping[str, ChoiceT] | None
The choices for the option. If provided, these will be the only valid values for the option.
description_localizations
property
#
The description of the option in different locales.
MemberOption
#
Bases: ConverterOption[InteractionMember, ClientT, MemberParams, User]
A slash command option that represents a member.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
MemberParams
#
MemberParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[InteractionMember]
The parameters for a member option.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
description_localizations
property
#
The description of the option in different locales.
MentionableOption
#
Bases: CommandOptionBase[Role | User, ClientT, MentionableParams]
A slash command option that represents a user or role.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
MentionableParams
#
MentionableParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[Role | User]
The parameters for a mentionable option.
This is an option of type hikari.Role | hikari.User
.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
description_localizations
property
#
The description of the option in different locales.
RoleOption
#
Bases: CommandOptionBase[Role, ClientT, RoleParams]
A slash command option that represents a role.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
RoleParams
#
RoleParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[Role]
The parameters for a user option.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The localizations for the name of the option |
description_localizations |
The localizations for the description of the option |
description_localizations
property
#
The description of the option in different locales.
StrOption
#
Bases: OptionWithChoices[str, ClientT, StrParams[ClientT]]
A slash command option that represents a string.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
autocomplete_with
class-attribute
instance-attribute
#
The callback for autocompleting the option.
choices
class-attribute
instance-attribute
#
choices: Sequence[ChoiceT | CommandChoice] | Mapping[str, ChoiceT] | None = None
The choices for the option.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
max_length
class-attribute
instance-attribute
#
The maximum length of the option.
min_length
class-attribute
instance-attribute
#
The minimum length of the option.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
StrParams
#
StrParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None,
min_length: int | None = None,
max_length: int | None = None,
choices: Sequence[str | CommandChoice] | Mapping[str, str] | None = None,
autocomplete_with: AutocompleteCallbackT[ClientT, str] | None = None
)
Bases: OptionWithChoicesParams[str, ClientT]
The parameters for a string option.
Warning
You cannot provide both choices
and autocomplete_with
at the same time.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
min_length |
The minimum length of the option
TYPE:
|
max_length |
The maximum length of the option
TYPE:
|
choices |
The choices for the option. If provided, these will be the only valid values for the option.
TYPE:
|
autocomplete_with |
The callback that is invoked when the user autocompletes the option
TYPE:
|
autocomplete_with
property
#
The callback for autocompleting the option.
choices
property
#
choices: Sequence[ChoiceT | CommandChoice] | Mapping[str, ChoiceT] | None
The choices for the option. If provided, these will be the only valid values for the option.
description_localizations
property
#
The description of the option in different locales.
UserOption
#
Bases: CommandOptionBase[User, ClientT, UserParams]
A slash command option that represents a user.
Hint
To add an option of this type to your command, add an argument to your command function with the following type hint:
arg_name
instance-attribute
#
arg_name: str
The name of the parameter this option represents.
This is going to be the same as name
unless name
was overriden.
description_localizations
class-attribute
instance-attribute
#
The description of the option in different locales.
is_required
class-attribute
instance-attribute
#
is_required: bool = True
Whether the option is required.
name_localizations
class-attribute
instance-attribute
#
The name of the option in different locales.
option_type
property
#
option_type: OptionType
The type of the option. Used to register the command.
to_command_option
#
to_command_option() -> CommandOption
Convert this option to a hikari.CommandOption.
UserParams
#
UserParams(
description: str = "No description provided.",
*,
name: str | None = None,
name_localizations: Mapping[Locale, str] | None = None,
description_localizations: Mapping[Locale, str] | None = None
)
Bases: OptionParams[User]
The parameters for a user option.
PARAMETER | DESCRIPTION |
---|---|
description |
The description of the option
TYPE:
|
name |
The name of the option. If not provided, the name of the parameter will be used.
TYPE:
|
name_localizations |
The name of the option in different locales
TYPE:
|
description_localizations |
The description of the option in different locales
TYPE:
|
description_localizations
property
#
The description of the option in different locales.