hikari.api.special_endpoints#
Special additional endpoints used by the REST API.
ContainerBuilderComponentsT module-attribute #
ContainerBuilderComponentsT = typing.Union[
MessageActionRowBuilder,
TextDisplayComponentBuilder,
SectionComponentBuilder,
MediaGalleryComponentBuilder,
SeparatorComponentBuilder,
FileComponentBuilder,
]
MessageActionRowBuilderComponentsT module-attribute #
MessageActionRowBuilderComponentsT = typing.Union[
ButtonBuilder, SelectMenuBuilder
]
ModalActionRowBuilderComponentsT module-attribute #
ModalActionRowBuilderComponentsT = TextInputBuilder
SectionBuilderAccessoriesT module-attribute #
SectionBuilderAccessoriesT = typing.Union[
ButtonBuilder, ThumbnailComponentBuilder
]
SectionBuilderComponentsT module-attribute #
SectionBuilderComponentsT = typing.Union[
TextDisplayComponentBuilder
]
AutoModActionBuilder #
Bases: ABC
Builder class for auto mod actions.
build abstractmethod #
build() -> MutableMapping[str, Any]
Build a JSON object from this builder.
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
AutoModBlockMemberInteractionActionBuilder #
Bases: AutoModActionBuilder, ABC
Builder class for auto mod block member interaction action.
type abstractmethod property #
type: Literal[BLOCK_MEMBER_INTERACTION]
Type of action this builder represents.
AutoModBlockMessageActionBuilder #
Bases: AutoModActionBuilder, ABC
Builder class for auto mod block message action.
AutoModKeywordPresetTriggerBuilder #
Bases: AutoModTriggerBuilder, ABC
Builder class for auto mod keyword preset trigger.
allow_list abstractmethod property #
A sequence of filters which will be exempt from triggering the preset trigger.
This supports a wildcard matching strategy which is documented at https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies.
presets abstractmethod property #
presets: Sequence[AutoModKeywordPresetType]
The predefined presets provided by Discord to match against.
type abstractmethod property #
type: Literal[KEYWORD_PRESET]
Type of trigger this builder represents.
AutoModKeywordTriggerBuilder #
Bases: AutoModTriggerBuilder, ABC
Builder class for auto mod keyword trigger.
allow_list abstractmethod property #
A sequence of filters which will be exempt from triggering the preset trigger.
This supports a wildcard matching strategy which is documented at https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies.
keyword_filter abstractmethod property #
The filter strings this trigger checks for.
This supports a wildcard matching strategy which is documented at https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies.
regex_patterns abstractmethod property #
The filter regexs this trigger checks for.
Currently, this only supports rust flavored regular expressions. https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata
AutoModMemberProfileTriggerBuilder #
Bases: AutoModTriggerBuilder, ABC
Builder class for auto mod member profile trigger.
allow_list abstractmethod property #
A sequence of filters which will be exempt from triggering the preset trigger.
This supports a wildcard matching strategy which is documented at https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies.
keyword_filter abstractmethod property #
The filter strings this trigger checks for.
This supports a wildcard matching strategy which is documented at https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies.
regex_patterns abstractmethod property #
The filter regexs this trigger checks for.
Currently, this only supports rust flavored regular expressions. https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata.
type abstractmethod property #
type: Literal[MEMBER_PROFILE]
Type of trigger this builder represents.
AutoModMentionSpamTriggerBuilder #
Bases: AutoModTriggerBuilder, ABC
Builder class for auto mod mention spam trigger.
AutoModSendAlertMessageActionBuilder #
Bases: AutoModActionBuilder, ABC
Builder class for auto mod send alert message action.
channel_id abstractmethod property #
channel_id: Snowflake
The channel to send the alert message to.
type abstractmethod property #
type: Literal[SEND_ALERT_MESSAGE]
Type of action this builder represents.
AutoModSpamTriggerBuilder #
Bases: AutoModTriggerBuilder, ABC
Builder class for auto mod spam trigger.
AutoModTimeoutActionBuilder #
AutoModTriggerBuilder #
Bases: ABC
Builder class for auto mod triggers.
build abstractmethod #
build() -> MutableMapping[str, Any]
Build a JSON object from this builder.
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
AutocompleteChoiceBuilder #
Bases: ABC
Interface of an autocomplete choice used to respond to interactions.
build abstractmethod #
build() -> MutableMapping[str, Any]
Build a JSON object from this builder.
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
set_name abstractmethod #
set_name(name: str) -> Self
Set this choice's name.
| RETURNS | DESCRIPTION |
|---|---|
AutocompleteChoiceBuilder | The autocomplete choice builder. |
set_value abstractmethod #
Set this choice's value.
| RETURNS | DESCRIPTION |
|---|---|
AutocompleteChoiceBuilder | The autocomplete choice builder. |
ButtonBuilder #
Bases: ComponentBuilder, ABC
Builder class for a message button component.
emoji abstractmethod property #
emoji: Snowflakeish | Emoji | str | UndefinedType
Emoji which should appear on this button.
is_disabled abstractmethod property #
is_disabled: bool
Whether the button should be marked as disabled.
label abstractmethod property #
label: UndefinedOr[str]
Text label which should appear on this button.
Note
The text label to that should appear on this button. This may be up to 80 characters long.
set_emoji abstractmethod #
set_emoji(
emoji: Snowflakeish | Emoji | str | UndefinedType,
) -> Self
Set the emoji to display on this button.
| PARAMETER | DESCRIPTION |
|---|---|
emoji | Object, ID or raw string of the emoji which should be displayed on this button. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ButtonBuilder | The builder object to enable chained calls. |
set_is_disabled abstractmethod #
set_is_disabled(state: bool) -> Self
Set whether this button should be disabled.
| PARAMETER | DESCRIPTION |
|---|---|
state | Whether this button should be disabled. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ButtonBuilder | The builder object to enable chained calls. |
set_label abstractmethod #
set_label(label: UndefinedOr[str]) -> Self
Set the text label which should be displayed on this button.
| PARAMETER | DESCRIPTION |
|---|---|
label | The text label to show on this button. This may be up to 80 characters long. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ButtonBuilder | The builder object to enable chained calls. |
ChannelRepositioner #
Bases: ABC
Helper class used for repositioning channels in a guild.
This is an object that should be awaited to trigger the repositioning. Only channels to be modified are required.
Note
This class should only be initialized by hikari.api.rest.RESTClient.reposition_channels.
Examples:
Basic usage:
channel_repositioner = rest.reposition_channels(
guild=GUILD_ID, reason="The reason."
)
channel_repositioner.add_reposition_channel(position=2, channel=CHANNEL_ID)
await channel_repositioner
channel_repositioner = rest.reposition_channels(guild=GUILD_ID)
channel_repositioner.add_reposition_channel(
position=1, channel=CHANNEL_ID, lock_permissions=True, parent=CATEGORY_ID
)
# when lock_permissions is set to True, the channels permissions will be synced
# with the new parent.
await channel_repositioner
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you cannot access the channel. |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
reason abstractmethod property #
reason: UndefinedOr[str]
If provided, the reason that will be recorded in the audit logs.
Maximum of 512 characters.
add_reposition_channel abstractmethod #
add_reposition_channel(
position: int,
channel: SnowflakeishOr[GuildChannel],
*,
lock_permissions: UndefinedOr[bool] = UNDEFINED,
parent: UndefinedOr[
SnowflakeishOr[GuildCategory]
] = UNDEFINED,
) -> Self
Add a channel that should be repositioned to the channel repositioner.
| PARAMETER | DESCRIPTION |
|---|---|
position | The new position for the channel. TYPE: |
channel | The channel that should be repositioned. This can either be a TYPE: |
lock_permissions | Whether the channel should sync permissions to the new parent channel or not. When set to TYPE: |
parent | The id of the parent where this channel should be repositioned under. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ChannelRepositioner | The channel repositioner. |
set_guild abstractmethod #
set_guild(guild: SnowflakeishOr[PartialGuild]) -> Self
Set the guild.
| RETURNS | DESCRIPTION |
|---|---|
ChannelRepositioner | The channel repositioner. |
set_positions abstractmethod #
set_positions(
positions: Sequence[RepositionedChannel],
) -> Self
Set the positions.
| RETURNS | DESCRIPTION |
|---|---|
ChannelRepositioner | The channel repositioner. |
set_reason abstractmethod #
set_reason(reason: UndefinedOr[str]) -> Self
Set the reason.
| RETURNS | DESCRIPTION |
|---|---|
ChannelRepositioner | The channel repositioner. |
ChannelSelectMenuBuilder #
Bases: SelectMenuBuilder, ABC
Builder class for a channel select menu.
channel_types abstractmethod property #
channel_types: Sequence[ChannelType]
The channel types that can be selected in this menu.
set_channel_types abstractmethod #
set_channel_types(value: Sequence[ChannelType]) -> Self
Set the valid channel types for this menu.
| PARAMETER | DESCRIPTION |
|---|---|
value | The valid channel types for this menu. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectMenuBuilder | The builder object to enable chained calls. |
CommandBuilder #
Bases: ABC
Interface of a command builder used when bulk creating commands over REST.
context_types abstractmethod property #
context_types: UndefinedOr[Sequence[ApplicationContextType]]
The context types allowed for this command.
default_member_permissions abstractmethod property #
default_member_permissions: (
UndefinedType | Permissions | int
)
Member permissions necessary to utilize this command by default.
If 0, then it will be available for all members. Note that this doesn't affect administrators of the guild and overwrites.
integration_types abstractmethod property #
integration_types: UndefinedOr[
Sequence[ApplicationIntegrationType]
]
The integration types allowed for this command.
name abstractmethod property #
name: str
Name to set for this command.
Warning
This should match the regex ^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$ in Unicode mode and must be lowercase.
name_localizations abstractmethod property #
Name localizations set for this command.
build abstractmethod #
build(
entity_factory: EntityFactory,
) -> MutableMapping[str, Any]
Build a JSON object from this builder.
| PARAMETER | DESCRIPTION |
|---|---|
entity_factory | The entity factory to use to serialize entities within this builder. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
create abstractmethod async #
create(
rest: RESTClient,
application: SnowflakeishOr[PartialApplication],
/,
*,
guild: UndefinedOr[
SnowflakeishOr[PartialGuild]
] = UNDEFINED,
) -> PartialCommand
Create this command through a REST call.
| PARAMETER | DESCRIPTION |
|---|---|
rest | The REST client to use to make this request. TYPE: |
application | The application to create this command for. TYPE: |
guild | The guild to create this command for. If left undefined then this command will be declared globally. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
PartialCommand | The created command. |
set_context_types abstractmethod #
set_context_types(
context_types: UndefinedOr[
Sequence[ApplicationContextType]
],
) -> Self
Set the context types for this command.
| PARAMETER | DESCRIPTION |
|---|---|
context_types | The context types to set for this command. |
| RETURNS | DESCRIPTION |
|---|---|
CommandBuilder | Object of this command builder. |
set_default_member_permissions abstractmethod #
set_default_member_permissions(
default_member_permissions: UndefinedType
| int
| Permissions,
) -> Self
Set the member permissions necessary to utilize this command by default.
| PARAMETER | DESCRIPTION |
|---|---|
default_member_permissions | The default member permissions to utilize this command by default. If TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
CommandBuilder | Object of this command builder. |
set_id abstractmethod #
set_id(id_: UndefinedOr[Snowflakeish]) -> Self
Set the ID of this command.
| PARAMETER | DESCRIPTION |
|---|---|
id_ | The ID to set for this command. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
CommandBuilder | Object of this command builder to allow for chained calls. |
set_integration_types abstractmethod #
set_integration_types(
integration_types: UndefinedOr[
Sequence[ApplicationIntegrationType]
],
) -> Self
Set the integration types for this command.
| PARAMETER | DESCRIPTION |
|---|---|
integration_types | The integration types to set for this command. |
| RETURNS | DESCRIPTION |
|---|---|
CommandBuilder | Object of this command builder. |
set_is_nsfw abstractmethod #
set_is_nsfw(state: UndefinedOr[bool]) -> Self
Set whether this command will be age-restricted.
| PARAMETER | DESCRIPTION |
|---|---|
state | Whether this command is age-restricted. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
CommandBuilder | Object of this command builder for chained calls. |
set_name abstractmethod #
set_name(name: str) -> Self
Set the name of this command.
| PARAMETER | DESCRIPTION |
|---|---|
name | The name to set for this command. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
CommandBuilder | Object of this command builder to allow for chained calls. |
set_name_localizations abstractmethod #
Set the name localizations for this command.
| PARAMETER | DESCRIPTION |
|---|---|
name_localizations | The name localizations to set for this command. |
| RETURNS | DESCRIPTION |
|---|---|
CommandBuilder | Object of this command builder. |
ComponentBuilder #
Bases: ABC
Base class for all component builder classes.
id abstractmethod property #
id: UndefinedOr[int]
ID of the component.
It will be used to order components in the layout.
If not provided, it will be auto populated through increment.
build abstractmethod #
build() -> tuple[
MutableMapping[str, Any],
Sequence[Resource[AsyncReader]],
]
Build a JSON object from this builder and collects all attachments added as components.
| RETURNS | DESCRIPTION |
|---|---|
tuple[MutableMapping[str, Any], Sequence[Resource[AsyncReader]]] | The built json object representation of this builder, and the attachments added. |
ContainerComponentBuilder #
Bases: ComponentBuilder, ABC
Builder class for container components.
accent_color abstractmethod property #
accent_color: UndefinedOr[Color]
The accent color for the container.
If undefined, the accent colour is hidden, if None, then no colour is set.
components abstractmethod property #
components: Sequence[ContainerBuilderComponentsT]
The components attached to the container.
add_action_row abstractmethod #
add_action_row(
components: Sequence[
MessageActionRowBuilderComponentsT
],
*,
id: UndefinedOr[int] = UNDEFINED,
) -> Self
Add a action row component to this container builder.
| PARAMETER | DESCRIPTION |
|---|---|
components | The components to add to the action row. |
id | The ID to give to the action row. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ContainerComponentBuilder | The builder object to enable chained calls. |
add_component abstractmethod #
add_component(
component: ContainerBuilderComponentsT,
) -> Self
Add a component to this container builder.
Warning
It is generally better to use hikari.api.special_endpoints.ContainerComponentBuilder.add_action_row and hikari.api.special_endpoints.ContainerComponentBuilder.add_text_display and hikari.api.special_endpoints.ContainerComponentBuilder.add_media_gallery and hikari.api.special_endpoints.ContainerComponentBuilder.add_separator and hikari.api.special_endpoints.ContainerComponentBuilder.add_file to add your component to the builder. Those methods utilize this one.
| PARAMETER | DESCRIPTION |
|---|---|
component | The component builder to add to the container. |
| RETURNS | DESCRIPTION |
|---|---|
ContainerComponentBuilder | The builder object to enable chained calls. |
add_file abstractmethod #
add_file(
file: Resourceish,
*,
spoiler: bool = False,
id: UndefinedOr[int] = UNDEFINED,
) -> Self
Add a spoiler component to this container builder.
| PARAMETER | DESCRIPTION |
|---|---|
file | The file. TYPE: |
spoiler | Whether the file has a spoiler. TYPE: |
id | The ID to give to the file. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ContainerComponentBuilder | The builder object to enable chained calls. |
add_media_gallery abstractmethod #
add_media_gallery(
items: Sequence[MediaGalleryItemBuilder],
*,
id: UndefinedOr[int] = UNDEFINED,
) -> Self
Add a media gallery component to this container builder.
| PARAMETER | DESCRIPTION |
|---|---|
items | The gallery media items to add to the media gallery. TYPE: |
id | The ID to give to the media gallery. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ContainerComponentBuilder | The builder object to enable chained calls. |
add_separator abstractmethod #
add_separator(
*,
spacing: SpacingType = SMALL,
divider: bool = False,
id: UndefinedOr[int] = UNDEFINED,
) -> Self
Add a separator component to this container builder.
| PARAMETER | DESCRIPTION |
|---|---|
spacing | The spacing for the separator. TYPE: |
divider | Whether the separator has a divider. TYPE: |
id | The ID to give to the separator. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ContainerComponentBuilder | |
add_text_display abstractmethod #
add_text_display(
content: str, *, id: UndefinedOr[int] = UNDEFINED
) -> Self
Add a text display component to this container builder.
| PARAMETER | DESCRIPTION |
|---|---|
content | The content of the text display. TYPE: |
id | The ID to give to the text display. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ContainerComponentBuilder | The builder object to enable chained calls. |
ContextMenuCommandBuilder #
Bases: CommandBuilder
ContextMenuCommandBuilder.
create abstractmethod async #
create(
rest: RESTClient,
application: SnowflakeishOr[PartialApplication],
/,
*,
guild: UndefinedOr[
SnowflakeishOr[PartialGuild]
] = UNDEFINED,
) -> ContextMenuCommand
Create this command through a REST call.
This is a shorthand for calling hikari.api.rest.RESTClient.create_context_menu_command with the builder's information.
| PARAMETER | DESCRIPTION |
|---|---|
rest | The REST client to use to make this request. TYPE: |
application | The application to create this command for. TYPE: |
guild | The guild to create this command for. If left undefined then this command will be declared globally. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ContextMenuCommand | The created command. |
FileComponentBuilder #
Bases: ComponentBuilder, ABC
Builder class for file components.
GuildOnboardingPromptBuilder #
Bases: ABC
Interface of a guild onboarding prompt used to respond to edit guild onboardings.
Note
You cannot set the type of the prompt. Discord will automatically do that based on how many options the prompt has.
id abstractmethod property #
The prompt's id.
options abstractmethod property #
options: Sequence[GuildOnboardingPromptOptionBuilder]
The prompt's title.
add_option abstractmethod #
add_option(
title: str,
role_ids: UndefinedNoneOr[
SnowflakeishSequence[Role]
] = UNDEFINED,
channel_ids: UndefinedNoneOr[
SnowflakeishSequence[GuildChannel]
] = UNDEFINED,
description: UndefinedOr[str] = UNDEFINED,
emoji: UndefinedOr[
Snowflakeish | Emoji | str
] = UNDEFINED,
) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
build abstractmethod #
build() -> MutableMapping[str, Any]
Build a JSON object from this builder.
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
set_id abstractmethod #
set_id(
id: UndefinedOr[SnowflakeishOr[GuildOnboardingPrompt]],
) -> Self
Set this prompt's id.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_in_onboarding abstractmethod #
set_in_onboarding(in_onboarding: bool) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_options abstractmethod #
set_options(
options: Sequence[GuildOnboardingPromptOptionBuilder],
) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_required abstractmethod #
set_required(required: bool) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_single_select abstractmethod #
set_single_select(single_select: bool) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_title abstractmethod #
set_title(title: str) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
GuildOnboardingPromptOptionBuilder #
Bases: ABC
Interface of a guild onboarding prompt option used to edit guild onboardings.
channel_ids abstractmethod property #
channel_ids: SnowflakeishSequence[GuildChannel]
The prompt's title.
emoji abstractmethod property #
emoji: UndefinedOr[Snowflakeish | Emoji | str]
Emoji which should appear on this option.
build abstractmethod #
build() -> MutableMapping[str, Any]
Build a JSON object from this builder.
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
set_channel_ids abstractmethod #
set_channel_ids(
channel_ids: SnowflakeishSequence[GuildChannel],
) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_description abstractmethod #
set_description(title: UndefinedOr[str]) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_emoji abstractmethod #
set_emoji(
emoji: UndefinedOr[Snowflakeish | Emoji | str],
) -> Self
Set the emoji to display on this option.
| PARAMETER | DESCRIPTION |
|---|---|
emoji | Object, ID or raw string of the emoji which should be displayed on this option. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_role_ids abstractmethod #
set_role_ids(role_ids: SnowflakeishSequence[Role]) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
set_title abstractmethod #
set_title(title: str) -> Self
Set this prompt's title.
| RETURNS | DESCRIPTION |
|---|---|
GuildOnboardingPromptBuilder | The guild onboarding builder. |
InteractionAutocompleteBuilder #
Bases: InteractionResponseBuilder, ABC
Interface of an autocomplete interaction response builder.
choices abstractmethod property #
choices: Sequence[AutocompleteChoiceBuilder]
Autocomplete choices.
set_choices abstractmethod #
set_choices(
choices: Sequence[AutocompleteChoiceBuilder],
) -> Self
Set autocomplete choices.
| PARAMETER | DESCRIPTION |
|---|---|
choices | The choices to set. |
| RETURNS | DESCRIPTION |
|---|---|
InteractionAutocompleteBuilder | Object of this builder. |
InteractionDeferredBuilder #
Bases: InteractionResponseBuilder, ABC
Interface of a deferred message interaction response builder.
flags abstractmethod property #
flags: UndefinedType | int | MessageFlag
Message flags this response should have.
Note
As of writing the only message flags which can be set here are hikari.messages.MessageFlag.EPHEMERAL, hikari.messages.MessageFlag.SUPPRESS_NOTIFICATIONS and hikari.messages.MessageFlag.SUPPRESS_EMBEDS.
set_flags abstractmethod #
set_flags(flags: UndefinedType | int | MessageFlag) -> Self
Set message flags for this response.
Note
As of writing, the only message flags which can be set are hikari.messages.MessageFlag.EPHEMERAL hikari.messages.MessageFlag.SUPPRESS_NOTIFICATIONS and hikari.messages.MessageFlag.SUPPRESS_EMBEDS.
| PARAMETER | DESCRIPTION |
|---|---|
flags | The message flags to set for this response. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder. |
InteractionMessageBuilder #
Bases: InteractionResponseBuilder, ABC
Interface of an interaction message response builder used within REST servers.
This can be returned by the listener registered to hikari.api.interaction_server.InteractionServer as a response to the interaction create.
attachments abstractmethod property #
attachments: UndefinedNoneOr[Sequence[Resourceish]]
Sequence of up to 10 attachments to send with the message.
components abstractmethod property #
components: UndefinedNoneOr[Sequence[ComponentBuilder]]
Sequence of up to 5 component builders to send in this response.
embeds abstractmethod property #
embeds: UndefinedNoneOr[Sequence[Embed]]
Sequence of up to 10 of the embeds included in this response.
flags abstractmethod property #
flags: UndefinedType | int | MessageFlag
Message flags this response should have.
Note
As of writing the only message flags which can be set here are hikari.messages.MessageFlag.EPHEMERAL, hikari.messages.MessageFlag.SUPPRESS_NOTIFICATIONS and hikari.messages.MessageFlag.SUPPRESS_EMBEDS.
is_tts abstractmethod property #
is_tts: UndefinedOr[bool]
Whether this response's content should be treated as text-to-speech.
mentions_everyone abstractmethod property #
mentions_everyone: UndefinedOr[bool]
Whether @everyone and @here mentions should be enabled for this response.
poll abstractmethod property #
poll: UndefinedOr[PollBuilder]
The poll to include with this response.
role_mentions abstractmethod property #
role_mentions: UndefinedOr[
SnowflakeishSequence[PartialRole] | bool
]
Whether and what role mentions should be enabled for this response.
Either a sequence of object/IDs of the roles mentions should be enabled for, False or hikari.undefined.UNDEFINED to disallow any role mentions or True to allow all role mentions.
user_mentions abstractmethod property #
user_mentions: UndefinedOr[
SnowflakeishSequence[PartialUser] | bool
]
Whether and what user mentions should be enabled for this response.
Either a sequence of object/IDs of the users mentions should be enabled for, False or hikari.undefined.UNDEFINED to disallow any user mentions or True to allow all user mentions.
add_attachment abstractmethod #
add_attachment(attachment: Resourceish) -> Self
Add an attachment to this response.
| PARAMETER | DESCRIPTION |
|---|---|
attachment | The attachment to add. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder. |
add_component abstractmethod #
add_component(component: ComponentBuilder) -> Self
Add a component to this response.
| PARAMETER | DESCRIPTION |
|---|---|
component | The component builder to add to this response. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder. |
add_embed abstractmethod #
add_embed(embed: Embed) -> Self
Add an embed to this response.
| PARAMETER | DESCRIPTION |
|---|---|
embed | Object of the embed to add to this response. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
clear_attachments abstractmethod #
clear_attachments() -> Self
Clear attachments for this response.
This is only useful for message update responses, where you might want to remove all existing attachments.
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder. |
clear_components abstractmethod #
clear_components() -> Self
Clear the components set for this response.
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
clear_embeds abstractmethod #
clear_embeds() -> Self
Clear the embeds set for this embed.
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
set_content abstractmethod #
set_content(content: UndefinedOr[str]) -> Self
Set the response's message content.
| PARAMETER | DESCRIPTION |
|---|---|
content | The message content to set for this response. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
set_flags abstractmethod #
set_flags(flags: UndefinedType | int | MessageFlag) -> Self
Set message flags for this response.
Note
As of writing, the only message flags which can be set is hikari.messages.MessageFlag.EPHEMERAL and hikari.messages.MessageFlag.SUPPRESS_NOTIFICATIONS.
| PARAMETER | DESCRIPTION |
|---|---|
flags | The message flags to set for this response. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
set_mentions_everyone abstractmethod #
set_mentions_everyone(
mentions: UndefinedOr[bool] = UNDEFINED,
) -> Self
Set whether this response should be able to mention @everyone/@here.
| PARAMETER | DESCRIPTION |
|---|---|
mentions | Whether this response should be able to mention @everyone/@here. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
set_poll abstractmethod #
set_poll(poll: UndefinedOr[PollBuilder]) -> Self
Set the poll to include with this response.
| PARAMETER | DESCRIPTION |
|---|---|
poll | The poll to include with this response, or TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
set_role_mentions abstractmethod #
set_role_mentions(
mentions: UndefinedOr[
SnowflakeishSequence[PartialRole] | bool
] = UNDEFINED,
) -> Self
Set whether and what role mentions should be possible for this response.
| PARAMETER | DESCRIPTION |
|---|---|
mentions | Either a sequence of object/IDs of the roles mentions should be enabled for, TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
set_tts abstractmethod #
set_tts(tts: UndefinedOr[bool]) -> Self
Set whether this response should trigger text-to-speech processing.
| PARAMETER | DESCRIPTION |
|---|---|
tts | Whether this response should trigger text-to-speech processing. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
set_user_mentions abstractmethod #
set_user_mentions(
mentions: UndefinedOr[
SnowflakeishSequence[PartialUser] | bool
] = UNDEFINED,
) -> Self
Set whether and what user mentions should be possible for this response.
| PARAMETER | DESCRIPTION |
|---|---|
mentions | Either a sequence of object/IDs of the users mentions should be enabled for, TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractionMessageBuilder | Object of this builder to allow for chained calls. |
InteractionModalBuilder #
Bases: InteractionResponseBuilder, ABC
Interface of an interaction modal response builder used within REST servers.
This can be returned by the listener registered to hikari.api.interaction_server.InteractionServer as a response to the interaction create.
components abstractmethod property #
components: UndefinedOr[Sequence[ComponentBuilder]]
Sequence of component builders to send in this modal.
custom_id abstractmethod property #
custom_id: str
Developer set custom ID used for identifying interactions with this modal.
add_component abstractmethod #
add_component(component: ComponentBuilder) -> Self
Add a component to this modal.
| PARAMETER | DESCRIPTION |
|---|---|
component | The component builder to add to this modal. TYPE: |
InteractionResponseBuilder #
Bases: ABC
Base class for all interaction response builders used in the interaction server.
build abstractmethod #
build(
entity_factory: EntityFactory,
) -> tuple[
MutableMapping[str, Any],
Sequence[Resource[AsyncReader]],
]
Build a JSON object from this builder.
| PARAMETER | DESCRIPTION |
|---|---|
entity_factory | The entity factory to use to serialize entities within this builder. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
typing.Tuple[typing.MutableMapping[str, typing.Any], typing.Sequence[files.Resource[Files.AsyncReader]] | A tuple of the built json object representation of this builder and a sequence of up to 10 files to send with the response. |
InteractiveButtonBuilder #
Bases: ButtonBuilder, ABC
Builder interface for interactive buttons.
custom_id abstractmethod property #
custom_id: str
Developer set custom ID used for identifying interactions with this button.
set_custom_id abstractmethod #
set_custom_id(custom_id: str) -> Self
Set the custom ID used for identifying this button.
| PARAMETER | DESCRIPTION |
|---|---|
custom_id | Developer set custom ID used for identifying this button. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
InteractiveButtonBuilder | The builder object to enable chained calls. |
LinkButtonBuilder #
Bases: ButtonBuilder, ABC
Builder interface for link buttons.
MediaGalleryComponentBuilder #
Bases: ComponentBuilder, ABC
Builder class for media gallery components.
items abstractmethod property #
items: Sequence[MediaGalleryItemBuilder]
The items in the media gallery.
type abstractmethod property #
type: Literal[MEDIA_GALLERY]
Type of component this builder represents.
add_item abstractmethod #
add_item(item: MediaGalleryItemBuilder) -> Self
Add a component to this media gallery builder.
Warning
It is generally better to use hikari.api.special_endpoints.MediaGalleryComponentBuilder.add_media_gallery_item to add your component to the builder. Those methods utilize this one.
| PARAMETER | DESCRIPTION |
|---|---|
item | The media gallery item builder to add to the section. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
MediaGalleryComponentBuilder | The builder object to enable chained calls. |
add_media_gallery_item abstractmethod #
add_media_gallery_item(
media: Resourceish,
*,
description: UndefinedOr[str] = UNDEFINED,
spoiler: bool = False,
) -> Self
Add a media gallery item component to this media gallery builder.
| PARAMETER | DESCRIPTION |
|---|---|
media | The media for the gallery item. TYPE: |
description | The description for the media gallery item. TYPE: |
spoiler | Whether the media has a spoiler. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
MediaGalleryComponentBuilder | The builder object to enable chained calls. |
MediaGalleryItemBuilder #
Bases: ABC
Builder class for a media gallery item.
description abstractmethod property #
description: UndefinedOr[str]
The description for the media gallery item.
build abstractmethod #
build() -> tuple[
MutableMapping[str, Any],
Sequence[Resource[AsyncReader]],
]
Build a JSON object from this builder and collects all attachments added as components.
| RETURNS | DESCRIPTION |
|---|---|
tuple[MutableMapping[str, Any], Sequence[Resource[AsyncReader]]] | The built json object representation of this builder, and the attachments added. |
MessageActionRowBuilder #
Bases: ComponentBuilder, ABC
Builder class for action row components.
components abstractmethod property #
components: Sequence[MessageActionRowBuilderComponentsT]
Sequence of the component builders registered within this action row.
add_channel_menu abstractmethod #
add_channel_menu(
custom_id: str,
/,
*,
channel_types: Sequence[ChannelType] = (),
placeholder: UndefinedOr[str] = UNDEFINED,
min_values: int = 0,
max_values: int = 1,
is_disabled: bool = False,
id: UndefinedOr[int] = UNDEFINED,
) -> Self
Add a channel select menu component to this action row builder.
| PARAMETER | DESCRIPTION |
|---|---|
custom_id | A developer-defined custom identifier used to identify which menu triggered component interactions. TYPE: |
channel_types | The channel types this select menu should allow. If left as an empty sequence then there will be no channel type restriction. TYPE: |
placeholder | Placeholder text to show when no entries have been selected. TYPE: |
min_values | The minimum amount of entries which need to be selected. TYPE: |
max_values | The maximum amount of entries which can be selected. TYPE: |
is_disabled | Whether this select menu should be marked as disabled. TYPE: |
id | The ID to give to the menu. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ActionRowBuilder | The action row builder to enable chained calls. |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If an invalid select menu type is passed. |
add_component abstractmethod #
add_component(
component: MessageActionRowBuilderComponentsT,
) -> Self
Add a component to this action row builder.
Warning
It is generally better to use hikari.api.special_endpoints.MessageActionRowBuilder.add_interactive_button and hikari.api.special_endpoints.MessageActionRowBuilder.add_select_menu to add your component to the builder. Those methods utilize this one.
| PARAMETER | DESCRIPTION |
|---|---|
component | The component builder to add to the action row. |
| RETURNS | DESCRIPTION |
|---|---|
ActionRowBuilder | The builder object to enable chained calls. |
add_interactive_button abstractmethod #
add_interactive_button(
style: InteractiveButtonTypesT,
custom_id: str,
/,
*,
emoji: Snowflakeish
| Emoji
| str
| UndefinedType = UNDEFINED,
label: UndefinedOr[str] = UNDEFINED,
is_disabled: bool = False,
id: UndefinedOr[int] = UNDEFINED,
) -> Self
Add an interactive button component to this action row builder.
Either emoji or label (exclusively) must be provided to be the button's displayed label.
| PARAMETER | DESCRIPTION |
|---|---|
style | The button's style. TYPE: |
custom_id | The developer-defined custom identifier used to identify which button triggered component interactions. TYPE: |
emoji | The button's display emoji. TYPE: |
label | The button's display label. TYPE: |
is_disabled | Whether the button should be marked as disabled. TYPE: |
id | The ID to give to the button. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ActionRowBuilder | The action row builder to enable chained calls. |
add_link_button abstractmethod #
add_link_button(
url: str,
/,
*,
emoji: Snowflakeish
| Emoji
| str
| UndefinedType = UNDEFINED,
label: UndefinedOr[str] = UNDEFINED,
is_disabled: bool = False,
id: UndefinedOr[int] = UNDEFINED,
) -> Self
Add a link button component to this action row builder.
Either emoji or label (exclusively) must be provided to be the button's displayed label.
| PARAMETER | DESCRIPTION |
|---|---|
url | The URL the link button should redirect to. TYPE: |
emoji | The button's display emoji. TYPE: |
label | The button's display label. TYPE: |
is_disabled | Whether the button should be marked as disabled. TYPE: |
id | The ID to give to the button. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ActionRowBuilder | The action row builder to enable chained calls. |
add_premium_button abstractmethod #
add_premium_button(
sku_id: int, /, *, id: UndefinedOr[int] = UNDEFINED
) -> Self
Add a premium button component to this action row builder.
| PARAMETER | DESCRIPTION |
|---|---|
sku_id | The SKU ID that this button will link to. TYPE: |
id | The ID to give to the button. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ActionRowBuilder | The action row builder to enable chained calls. |
add_select_menu abstractmethod #
add_select_menu(
type_: ComponentType | int,
custom_id: str,
/,
*,
placeholder: UndefinedOr[str] = UNDEFINED,
min_values: int = 0,
max_values: int = 1,
is_disabled: bool = False,
id: UndefinedOr[int] = UNDEFINED,
) -> Self
Add a select menu component to this action row builder.
For channel select menus and text select menus see hikari.api.special_endpoints.MessageActionRowBuilder.add_channel_menu and hikari.api.special_endpoints.MessageActionRowBuilder.add_text_menu.
| PARAMETER | DESCRIPTION |
|---|---|
type_ | The type for the select menu. TYPE: |
custom_id | A developer-defined custom identifier used to identify which menu triggered component interactions. TYPE: |
placeholder | Placeholder text to show when no entries have been selected. TYPE: |
min_values | The minimum amount of entries which need to be selected. TYPE: |
max_values | The maximum amount of entries which can be selected. TYPE: |
is_disabled | Whether this select menu should be marked as disabled. TYPE: |
id | The ID to give to the menu. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ActionRowBuilder | The action row builder to enable chained calls. |
| RAISES | DESCRIPTION |
|---|---|
ValueError | If an invalid select menu type is passed. |
add_text_menu abstractmethod #
add_text_menu(
custom_id: str,
/,
*,
placeholder: UndefinedOr[str] = UNDEFINED,
min_values: int = 0,
max_values: int = 1,
is_disabled: bool = False,
id: UndefinedOr[int] = UNDEFINED,
) -> TextSelectMenuBuilder[Self]
Add a select menu component to this action row builder.
| PARAMETER | DESCRIPTION |
|---|---|
custom_id | A developer-defined custom identifier used to identify which menu triggered component interactions. TYPE: |
placeholder | Placeholder text to show when no entries have been selected. TYPE: |
min_values | The minimum amount of entries which need to be selected. TYPE: |
max_values | The maximum amount of entries which can be selected. TYPE: |
is_disabled | Whether this select menu should be marked as disabled. TYPE: |
id | The ID to give to the menu. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextSelectMenuBuilder | The text select menu builder.
|
| RAISES | DESCRIPTION |
|---|---|
ValueError | If an invalid select menu type is passed. |
ModalActionRowBuilder #
Bases: ComponentBuilder, ABC
Builder class for modal action row components.
components abstractmethod property #
components: Sequence[ModalActionRowBuilderComponentsT]
Sequence of the component builders registered within this action row.
add_component abstractmethod #
add_component(
component: ModalActionRowBuilderComponentsT,
) -> Self
Add a component to this action row builder.
Warning
It is generally better to use hikari.api.special_endpoints.MessageActionRowBuilder.add_interactive_button and hikari.api.special_endpoints.MessageActionRowBuilder.add_select_menu to add your component to the builder. Those methods utilize this one.
| PARAMETER | DESCRIPTION |
|---|---|
component | The component builder to add to the action row. |
| RETURNS | DESCRIPTION |
|---|---|
ActionRowBuilder | The builder object to enable chained calls. |
add_text_input abstractmethod #
add_text_input(
custom_id: str,
label: str,
/,
*,
style: TextInputStyle = SHORT,
placeholder: UndefinedOr[str] = UNDEFINED,
value: UndefinedOr[str] = UNDEFINED,
required: bool = True,
min_length: int = 0,
max_length: int = 4000,
) -> Self
Add a text input component to this action row builder.
| PARAMETER | DESCRIPTION |
|---|---|
custom_id | Developer set custom ID used for identifying this text input. TYPE: |
label | Label above this text input. TYPE: |
style | The text input's style. TYPE: |
placeholder | Placeholder text to display when the text input is empty. TYPE: |
value | Default text to pre-fill the field with. TYPE: |
required | Whether text must be supplied for this text input. TYPE: |
min_length | Minimum length the input text can be. This can be greater than or equal to 0 and less than or equal to 4000. TYPE: |
max_length | Maximum length the input text can be. This can be greater than or equal to 1 and less than or equal to 4000. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
ModalActionRowBuilder | The modal action row builder to enable call chaining. |
PollAnswerBuilder #
Bases: ABC
Builder class for poll answers.
build abstractmethod #
build() -> MutableMapping[str, Any]
Build a JSON object from this builder.
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
PollBuilder #
Bases: ABC
Builder class for polls.
allow_multiselect abstractmethod property #
allow_multiselect: bool
Whether a user can select multiple answers.
layout_type abstractmethod property #
layout_type: UndefinedOr[PollLayoutType]
The layout type for the poll.
add_answer abstractmethod #
add_answer(
*,
text: UndefinedOr[str] = UNDEFINED,
emoji: UndefinedOr[Emoji] = UNDEFINED,
) -> Self
Add an answer to the poll.
| PARAMETER | DESCRIPTION |
|---|---|
text | The text for the answer. TYPE: |
emoji | The emoji for the answer. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
PollAnswerBuilder | The builder object to enable chained calls. |
build abstractmethod #
build() -> MutableMapping[str, Any]
Build a JSON object from this builder.
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
PremiumButtonBuilder #
Bases: ButtonBuilder, ABC
Builder interface for premium buttons.
RepositionedChannel #
Bases: ABC
lock_permissions abstractmethod property #
lock_permissions: UndefinedOr[bool]
Lock permissions property.
parent abstractmethod property #
parent: UndefinedOr[SnowflakeishOr[GuildCategory]]
Parent property.
set_channel abstractmethod #
set_channel(channel: SnowflakeishOr[GuildChannel]) -> Self
Set the channel.
| RETURNS | DESCRIPTION |
|---|---|
RepositionedChannel | The reposition channel helper. |
set_lock_permissions abstractmethod #
set_lock_permissions(lock: UndefinedOr[bool]) -> Self
Set the lock.
| RETURNS | DESCRIPTION |
|---|---|
RepositionedChannel | The reposition channel helper. |
set_parent abstractmethod #
set_parent(
parent: UndefinedOr[SnowflakeishOr[GuildCategory]],
) -> Self
Set the parent.
| RETURNS | DESCRIPTION |
|---|---|
RepositionedChannel | The reposition channel helper. |
set_position abstractmethod #
set_position(position: int) -> Self
Set the position.
| RETURNS | DESCRIPTION |
|---|---|
RepositionedChannel | The reposition channel helper. |
SectionComponentBuilder #
Bases: ComponentBuilder, ABC
Builder class for section components.
accessory abstractmethod property #
accessory: SectionBuilderAccessoriesT
The accessory attached to the section.
components abstractmethod property #
components: Sequence[SectionBuilderComponentsT]
The components attached to the section.
add_component abstractmethod #
add_component(component: SectionBuilderComponentsT) -> Self
Add a component to this section builder.
Warning
It is generally better to use hikari.api.special_endpoints.SectionComponentBuilder.add_text_display to add your component to the builder. Those methods utilize this one.
| PARAMETER | DESCRIPTION |
|---|---|
component | The component builder to add to the section. |
| RETURNS | DESCRIPTION |
|---|---|
SectionComponentBuilder | The builder object to enable chained calls. |
add_text_display abstractmethod #
add_text_display(
content: str, *, id: UndefinedOr[int] = UNDEFINED
) -> Self
Add a text display component to this section builder.
| PARAMETER | DESCRIPTION |
|---|---|
content | The content for the text display. TYPE: |
id | The ID to give to the text display. If not provided, auto populated through increment. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SectionComponentBuilder | The builder object to enable chained calls. |
SelectMenuBuilder #
Bases: ComponentBuilder, ABC
Builder class for a select menu.
custom_id abstractmethod property #
custom_id: str
Developer set custom ID used for identifying interactions with this menu.
is_disabled abstractmethod property #
is_disabled: bool
Whether the select menu should be marked as disabled.
max_values abstractmethod property #
max_values: int
Maximum number of options which can be chosen.
Defaults to 1. Must be greater than or equal to hikari.api.special_endpoints.SelectMenuBuilder.min_values and less than or equal to 25.
min_values abstractmethod property #
min_values: int
Minimum number of options which must be chosen.
Defaults to 1. Must be less than or equal to hikari.api.special_endpoints.SelectMenuBuilder.max_values and greater than or equal to 0.
placeholder abstractmethod property #
placeholder: UndefinedOr[str]
Placeholder text to display when no options are selected.
set_custom_id abstractmethod #
set_custom_id(custom_id: str) -> Self
Set the custom ID used for identifying this menu.
| PARAMETER | DESCRIPTION |
|---|---|
custom_id | Developer set custom ID used for identifying this menu. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectMenuBuilder | The builder object to enable chained calls. |
set_is_disabled abstractmethod #
set_is_disabled(state: bool) -> Self
Set whether this option is disabled.
| PARAMETER | DESCRIPTION |
|---|---|
state | Whether this option is disabled. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectMenuBuilder | The builder object to enable chained calls. |
set_max_values abstractmethod #
set_max_values(value: int) -> Self
Set the maximum amount of options which can be selected for this menu.
Note
This defaults to 1 if not set and must be less than or equal to 25 and greater than or equal to hikari.api.special_endpoints.SelectMenuBuilder.min_values.
| PARAMETER | DESCRIPTION |
|---|---|
value | The maximum amount of options which can selected for this menu. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectMenuBuilder | The builder object to enable chained calls. |
set_min_values abstractmethod #
set_min_values(value: int) -> Self
Set the minimum amount of options which need to be selected for this menu.
Note
This defaults to 1 if not set and must be greater than or equal to 0 and less than or equal to hikari.api.special_endpoints.SelectMenuBuilder.max_values.
| PARAMETER | DESCRIPTION |
|---|---|
value | The minimum amount of options which need to be selected for this menu. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectMenuBuilder | The builder object to enable chained calls. |
set_placeholder abstractmethod #
set_placeholder(value: UndefinedOr[str]) -> Self
Set place-holder text to be shown when no option is selected.
| PARAMETER | DESCRIPTION |
|---|---|
value | Place-holder text to be displayed when no option is selected. Max 100 characters. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectMenuBuilder | The builder object to enable chained calls. |
SelectOptionBuilder #
Bases: ABC
Builder class for select menu options.
description abstractmethod property #
description: UndefinedOr[str]
Description of the option, max 100 characters.
emoji abstractmethod property #
emoji: Snowflakeish | Emoji | str | UndefinedType
Emoji which should appear on this option.
is_default abstractmethod property #
is_default: bool
Whether this option should be marked as selected by default.
value abstractmethod property #
value: str
Developer-defined value of the option, max 100 characters.
build abstractmethod #
build() -> MutableMapping[str, Any]
Build a JSON object from this builder.
| RETURNS | DESCRIPTION |
|---|---|
MutableMapping[str, Any] | The built json object representation of this builder. |
set_description abstractmethod #
set_description(value: UndefinedOr[str]) -> Self
Set the option's description.
| PARAMETER | DESCRIPTION |
|---|---|
value | Description to set for this option. This can be up to 100 characters long. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectOptionBuilder | The builder object to enable chained calls. |
set_emoji abstractmethod #
set_emoji(
emoji: Snowflakeish | Emoji | str | UndefinedType,
) -> Self
Set the emoji to display on this option.
| PARAMETER | DESCRIPTION |
|---|---|
emoji | Object, ID or raw string of the emoji which should be displayed on this option. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectOptionBuilder | The builder object to enable chained calls. |
set_is_default abstractmethod #
set_is_default(state: bool) -> Self
Set whether this option should be selected by default.
| PARAMETER | DESCRIPTION |
|---|---|
state | Whether this option should be selected by default. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectOptionBuilder | The builder object to enable chained calls. |
set_label abstractmethod #
set_label(label: str) -> Self
Set the option's label.
| PARAMETER | DESCRIPTION |
|---|---|
label | Label to set for this option. This can be up to 100 characters long. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectOptionBuilder | The builder object to enable chained calls. |
set_value abstractmethod #
set_value(value: str) -> Self
Set the option's value.
| PARAMETER | DESCRIPTION |
|---|---|
value | Value to set for this option. This can be up to 100 characters long. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SelectOptionBuilder | The builder object to enable chained calls. |
SeparatorComponentBuilder #
SlashCommandBuilder #
Bases: CommandBuilder
SlashCommandBuilder.
description abstractmethod property #
description: str
Command's description.
Warning
This should be inclusively between 1-100 characters in length.
description_localizations abstractmethod property #
Command's localised descriptions.
options abstractmethod property #
options: Sequence[CommandOption]
Sequence of up to 25 of the options set for this command.
add_option abstractmethod #
add_option(option: CommandOption) -> Self
Add an option to this command.
Note
A command can have up to 25 options.
| PARAMETER | DESCRIPTION |
|---|---|
option | The option to add to this command. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SlashCommandBuilder | Object of this command builder to allow for chained calls. |
create abstractmethod async #
create(
rest: RESTClient,
application: SnowflakeishOr[PartialApplication],
/,
*,
guild: UndefinedOr[
SnowflakeishOr[PartialGuild]
] = UNDEFINED,
) -> SlashCommand
Create this command through a REST call.
This is a shorthand for calling hikari.api.rest.RESTClient.create_slash_command with the builder's information.
| PARAMETER | DESCRIPTION |
|---|---|
rest | The REST client to use to make this request. TYPE: |
application | The application to create this command for. TYPE: |
guild | The guild to create this command for. If left undefined then this command will be declared globally. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SlashCommand | The created command. |
set_description abstractmethod #
set_description(description: str) -> Self
Set the description for this command.
| PARAMETER | DESCRIPTION |
|---|---|
description | The description to set for this command. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
SlashCommandBuilder | Object of this command builder. |
set_description_localizations abstractmethod #
Set the localised descriptions for this command.
| PARAMETER | DESCRIPTION |
|---|---|
description_localizations | The description localizations to set for this command. |
| RETURNS | DESCRIPTION |
|---|---|
SlashCommandBuilder | Object of this command builder. |
TextDisplayComponentBuilder #
Bases: ComponentBuilder, ABC
Builder class for text display components.
type abstractmethod property #
type: Literal[TEXT_DISPLAY]
Type of component this builder represents.
TextInputBuilder #
Bases: ComponentBuilder, ABC
Builder class for text inputs components.
custom_id abstractmethod property #
custom_id: str
Developer set custom ID used for identifying this text input.
Note
This custom_id is never used in component interaction events. It is meant to be used purely for resolving components modal interactions.
is_required abstractmethod property #
is_required: bool
Whether this text input is required to be filled-in.
placeholder abstractmethod property #
placeholder: UndefinedOr[str]
Placeholder text for when the text input is empty.
value abstractmethod property #
value: UndefinedOr[str]
Pre-filled text that will be sent if the user does not write anything.
set_custom_id abstractmethod #
set_custom_id(custom_id: str) -> Self
Set the custom ID used for identifying this text input.
| PARAMETER | DESCRIPTION |
|---|---|
custom_id | Developer set custom ID used for identifying this text input. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextInputBuilder | The builder object to enable chained calls. |
set_label abstractmethod #
set_label(label: str) -> Self
Set the label above this text input.
| PARAMETER | DESCRIPTION |
|---|---|
label | Label above this text input. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextInputBuilder | The builder object to enable chained calls. |
set_max_length abstractmethod #
set_max_length(max_length: int) -> Self
Set the maximum length the text should have.
| PARAMETER | DESCRIPTION |
|---|---|
max_length | The maximum length the text should have. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextInputBuilder | The builder object to enable chained calls. |
set_min_length abstractmethod #
set_min_length(min_length: int) -> Self
Set the minimum length the text should have.
| PARAMETER | DESCRIPTION |
|---|---|
min_length | The minimum length the text should have. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextInputBuilder | The builder object to enable chained calls. |
set_placeholder abstractmethod #
set_placeholder(placeholder: UndefinedOr[str]) -> Self
Set the placeholder text for when the text input is empty.
| PARAMETER | DESCRIPTION |
|---|---|
placeholder | Placeholder text that will disappear when the user types anything. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextInputBuilder | The builder object to enable chained calls. |
set_required abstractmethod #
set_required(required: bool) -> Self
Set whether this text input is required to be filled-in.
| PARAMETER | DESCRIPTION |
|---|---|
required | Whether this text input is required to be filled-in. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextInputBuilder | The builder object to enable chained calls. |
set_style abstractmethod #
set_style(style: TextInputStyle | int) -> Self
Set the style to use for the text input.
| PARAMETER | DESCRIPTION |
|---|---|
style | Style to use for the text input. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextInputBuilder | The builder object to enable chained calls. |
set_value abstractmethod #
set_value(value: UndefinedOr[str]) -> Self
Pre-filled text that will be sent if the user does not write anything.
| PARAMETER | DESCRIPTION |
|---|---|
value | Pre-filled text that will be sent if the user does not write anything. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextInputBuilder | The builder object to enable chained calls. |
TextSelectMenuBuilder #
Bases: SelectMenuBuilder, ABC, Generic[_ParentT_co]
Builder class for a text select menu.
options abstractmethod property #
options: Sequence[SelectOptionBuilder]
Sequence of the options set for this select menu.
add_option abstractmethod #
add_option(
label: str,
value: str,
/,
*,
description: UndefinedOr[str] = UNDEFINED,
emoji: Snowflakeish
| Emoji
| str
| UndefinedType = UNDEFINED,
is_default: bool = False,
) -> Self
Add an option to this menu.
| PARAMETER | DESCRIPTION |
|---|---|
label | The user-facing name of this option, max 100 characters. TYPE: |
value | The developer defined value of this option, max 100 characters. TYPE: |
description | The option's description. This can be up to 100 characters long. TYPE: |
emoji | The option's display emoji. TYPE: |
is_default | Whether this option should be selected by default. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
TextSelectMenuBuilder | The select menu builder to enable call chaining. |
ThumbnailComponentBuilder #
Bases: ComponentBuilder, ABC
Builder class for thumbnail components.
description abstractmethod property #
description: UndefinedOr[str]
The description for the thumbnails media.
TypingIndicator #
Bases: ABC
Result type of hikari.api.rest.RESTClient.trigger_typing.
This is an object that can either be awaited like a coroutine to trigger the typing indicator once, or an async context manager to keep triggering the typing indicator repeatedly until the context finishes.
Note
This is a helper class that is used by hikari.api.rest.RESTClient. You should only ever need to use instances of this class that are produced by that API.