Skip to content

hikari.impl.special_endpoints#

Special endpoint implementations.

You should never need to make any of these objects manually.

AuditLogIterator #

AuditLogIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    guild: SnowflakeishOr[PartialGuild],
    before: UndefinedOr[str],
    user: UndefinedOr[SnowflakeishOr[PartialUser]],
    action_type: UndefinedOr[AuditLogEventType | int],
)

Bases: LazyIterator['audit_logs.AuditLog']

Iterator implementation for an audit log.

AutoModBlockMemberInteractionActionBuilder #

Bases: AutoModBlockMemberInteractionActionBuilder

Standard implementation of hikari.api.special_endpoints.AutoModBlockMemberInteractionActionBuilder.

type property #

Type of action this builder represents.

build #

build() -> MutableMapping[str, Any]

Build a JSON object from this builder.

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

AutoModBlockMessageActionBuilder #

Bases: AutoModBlockMessageActionBuilder

Standard implementation of hikari.api.special_endpoints.AutoModBlockMessageActionBuilder.

custom_message property #

custom_message: str | None

The custom message sent when a message is blocked.

type property #

Type of action this builder represents.

build #

build() -> MutableMapping[str, Any]

Build a JSON object from this builder.

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

AutoModKeywordPresetTriggerBuilder #

Bases: AutoModKeywordPresetTriggerBuilder

Standard implementation of hikari.api.special_endpoints.AutoModKeywordPresetTriggerBuilder.

allow_list property #

allow_list: Sequence[str]

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 property #

The predefined presets provided by Discord to match against.

type property #

Type of trigger this builder represents.

build #

build() -> MutableMapping[str, Any]

Build a JSON object from this builder.

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

AutoModKeywordTriggerBuilder #

Bases: AutoModKeywordTriggerBuilder

Standard implementation of hikari.api.special_endpoints.AutoModKeywordTriggerBuilder.

allow_list property #

allow_list: Sequence[str]

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 property #

keyword_filter: Sequence[str]

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 property #

regex_patterns: Sequence[str]

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 property #

Type of trigger this builder represents.

build #

build() -> MutableMapping[str, Any]

Build a JSON object from this builder.

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

AutoModMemberProfileTriggerBuilder #

Bases: AutoModMemberProfileTriggerBuilder

Standard implementation of hikari.api.special_endpoints.AutoModMemberProfileTriggerBuilder.

allow_list property #

allow_list: Sequence[str]

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 property #

keyword_filter: Sequence[str]

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 property #

regex_patterns: Sequence[str]

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 property #

Type of trigger this builder represents.

build #

build() -> MutableMapping[str, Any]

Build a JSON object from this builder.

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

AutoModMentionSpamTriggerBuilder #

Bases: AutoModMentionSpamTriggerBuilder

Standard implementation of hikari.api.special_endpoints.AutoModSpamTriggerBuilder.

mention_raid_protection_enabled property #

mention_raid_protection_enabled: bool

Whether to automatically detect mention raids.

mention_total_limit property #

mention_total_limit: int

Total number of unique role and user mentions allowed per message.

type property #

Type of trigger this builder represents.

build #

build() -> MutableMapping[str, Any]

Build a JSON object from this builder.

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

AutoModSendAlertMessageActionBuilder #

Bases: AutoModSendAlertMessageActionBuilder

Standard implementation of hikari.api.special_endpoints.AutoModSendAlertMessageActionBuilder.

channel_id property #

channel_id: Snowflake

The channel to send the alert message to.

type property #

Type of action this builder represents.

build #

build() -> MutableMapping[str, Any]

Build a JSON object from this builder.

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

AutoModSpamTriggerBuilder #

Bases: AutoModSpamTriggerBuilder

Standard implementation of hikari.api.special_endpoints.AutoModSpamTriggerBuilder.

type property #

type: Literal[SPAM]

Type of trigger this builder represents.

build #

build() -> MutableMapping[str, Any]

Build a JSON object from this builder.

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

AutoModTimeoutActionBuilder #

Bases: AutoModTimeoutActionBuilder

Standard implementation of hikari.api.special_endpoints.AutoModTimeoutActionBuilder.

duration_seconds property #

duration_seconds: int

The amount of seconds to time the user out for.

type property #

Type of action this builder represents.

build #

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: AutocompleteChoiceBuilder

Standard implementation of hikari.api.special_endpoints.AutocompleteChoiceBuilder.

name property #

name: str

The choice's name.

value property #

value: int | str | float

The choice's value.

build #

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 #

set_name(name: str) -> Self

Set this choice's name.

RETURNS DESCRIPTION
AutocompleteChoiceBuilder

The autocomplete choice builder.

set_value #

set_value(value: float | str) -> Self

Set this choice's value.

RETURNS DESCRIPTION
AutocompleteChoiceBuilder

The autocomplete choice builder.

ChannelRepositioner #

Bases: ChannelRepositioner

Standard implementation of hikari.api.special_endpoints.ChannelRepositioner.

guild property #

The guild.

positions property #

The positions.

reason property #

reason: UndefinedOr[str]

If provided, the reason that will be recorded in the audit logs.

Maximum of 512 characters.

add_reposition_channel #

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: int

channel

The channel that should be repositioned. This can either be a [hikari.channels.GuildChannel][] or the id of the channel.

TYPE: SnowflakeishOr[GuildChannel]

lock_permissions

Whether the channel should sync permissions to the new parent channel or not. When set to False or UNDEFINED the channel will not sync its permissions to the new parent. Only when set to True the channel will sync its permissions to the new parent.

TYPE: UndefinedOr[bool] DEFAULT: UNDEFINED

parent

The id of the parent where this channel should be repositioned under.

TYPE: UndefinedOr[SnowflakeishOr[GuildCategory]] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ChannelRepositioner

The channel repositioner.

set_guild #

set_guild(guild: SnowflakeishOr[PartialGuild]) -> Self

Set the guild.

RETURNS DESCRIPTION
ChannelRepositioner

The channel repositioner.

set_positions #

set_positions(
    positions: Sequence[RepositionedChannel],
) -> Self

Set the positions.

RETURNS DESCRIPTION
ChannelRepositioner

The channel repositioner.

set_reason #

set_reason(reason: UndefinedOr[str]) -> Self

Set the reason.

RETURNS DESCRIPTION
ChannelRepositioner

The channel repositioner.

ChannelSelectMenuBuilder #

Bases: SelectMenuBuilder, ChannelSelectMenuBuilder

Builder class for channel select menus.

channel_types property #

channel_types: Sequence[ChannelType]

The channel types that can be selected in this menu.

build #

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.

set_channel_types #

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: Sequence[ChannelType]

RETURNS DESCRIPTION
SelectMenuBuilder

The builder object to enable chained calls.

CommandBuilder #

Bases: CommandBuilder, ABC

Standard implementation of hikari.api.special_endpoints.CommandBuilder.

context_types property #

The context types allowed for this command.

default_member_permissions 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.

id property #

ID of this command.

integration_types property #

The integration types allowed for this command.

is_nsfw property #

is_nsfw: UndefinedOr[bool]

Whether this command age-restricted.

name 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 property #

name_localizations: Mapping[Locale | str, str]

Name localizations set for this command.

build #

Build a JSON object from this builder.

PARAMETER DESCRIPTION
entity_factory

The entity factory to use to serialize entities within this builder.

TYPE: EntityFactory

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

set_context_types #

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.

TYPE: UndefinedOr[Sequence[ApplicationContextType]]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder.

set_default_member_permissions #

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 0, then it will be available for all members. Note that this doesn't affect administrators of the guild and overwrites.

TYPE: UndefinedType | int | Permissions

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder.

set_id #

set_id(id_: UndefinedOr[Snowflakeish]) -> Self

Set the ID of this command.

PARAMETER DESCRIPTION
id_

The ID to set for this command.

TYPE: UndefinedOr[Snowflakeish]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

set_integration_types #

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.

TYPE: UndefinedOr[Sequence[ApplicationIntegrationType]]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder.

set_is_nsfw #

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: UndefinedOr[bool]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder for chained calls.

set_name #

set_name(name: str) -> Self

Set the name of this command.

PARAMETER DESCRIPTION
name

The name to set for this command.

TYPE: str

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

set_name_localizations #

set_name_localizations(
    name_localizations: Mapping[Locale | str, str],
) -> Self

Set the name localizations for this command.

PARAMETER DESCRIPTION
name_localizations

The name localizations to set for this command.

TYPE: Mapping[Locale | str, str]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder.

ContainerComponentBuilder #

Bases: ContainerComponentBuilder

Standard implementation of hikari.api.special_endpoints.ContainerComponentBuilder.

accent_color 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 property #

The components attached to the container.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

is_spoiler property #

is_spoiler: bool

Whether the container has a spoiler.

type property #

Type of component this builder represents.

add_action_row #

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.

TYPE: Sequence[MessageActionRowBuilderComponentsT]

id

The ID to give to the action row.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ContainerComponentBuilder

The builder object to enable chained calls.

add_component #

add_component(
    component: ContainerBuilderComponentsT,
) -> Self

Add a component to this container builder.

PARAMETER DESCRIPTION
component

The component builder to add to the container.

TYPE: ContainerBuilderComponentsT

RETURNS DESCRIPTION
ContainerComponentBuilder

The builder object to enable chained calls.

add_file #

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: Resourceish

spoiler

Whether the file has a spoiler.

TYPE: bool DEFAULT: False

id

The ID to give to the file. If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ContainerComponentBuilder

The builder object to enable chained calls.

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: Sequence[MediaGalleryItemBuilder]

id

The ID to give to the media gallery.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ContainerComponentBuilder

The builder object to enable chained calls.

add_separator #

add_separator(
    *,
    spacing: UndefinedOr[SpacingType] = UNDEFINED,
    divider: UndefinedOr[bool] = UNDEFINED,
    id: UndefinedOr[int] = UNDEFINED,
) -> Self

Add a separator component to this container builder.

PARAMETER DESCRIPTION
spacing

The spacing for the separator.

TYPE: SpacingType DEFAULT: SMALL

divider

Whether the separator has a divider.

TYPE: bool DEFAULT: False

id

The ID to give to the separator.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ContainerComponentBuilder

add_text_display #

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: str

id

The ID to give to the text display.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ContainerComponentBuilder

The builder object to enable chained calls.

build #

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.

ContextMenuCommandBuilder #

Bases: CommandBuilder, ContextMenuCommandBuilder

Builder class for context menu commands.

type property #

Type of this command.

create async #

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: RESTClient

application

The application to create this command for.

TYPE: SnowflakeishOr[PartialApplication]

guild

The guild to create this command for.

If left undefined then this command will be declared globally.

TYPE: UndefinedOr[SnowflakeishOr[PartialGuild]] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ContextMenuCommand

The created command.

FileComponentBuilder #

Bases: FileComponentBuilder

Standard implementation of hikari.api.special_endpoints.FileComponentBuilder.

file property #

The file to attach.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

is_spoiler property #

is_spoiler: bool

Whether the file has a spoiler.

type property #

type: Literal[FILE]

Type of component this builder represents.

build #

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.

GuildBanIterator #

GuildBanIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    guild: SnowflakeishOr[PartialGuild],
    *,
    newest_first: bool,
    first_id: str,
)

Bases: BufferedLazyIterator['guilds.GuildBan']

Iterator implementation for retrieving guild bans.

GuildOnboardingPromptBuilder #

Bases: GuildOnboardingPromptBuilder

Standard implementation of hikari.api.special_endpoints.GuildOnboardingPromptBuilder.

id property #

The prompt's id.

in_onboarding property #

in_onboarding: bool

The prompt's title.

options property #

The prompt's title.

required property #

required: bool

The prompt's title.

single_select property #

single_select: bool

The prompt's title.

title property #

title: str

The prompt's title.

add_option #

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

build #

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 #

Set this prompt's id.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_in_onboarding #

set_in_onboarding(in_onboarding: bool) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_options #

set_options(
    options: Sequence[GuildOnboardingPromptOptionBuilder],
) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_required #

set_required(required: bool) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_single_select #

set_single_select(single_select: bool) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_title #

set_title(title: str) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

GuildOnboardingPromptOptionBuilder #

Bases: GuildOnboardingPromptOptionBuilder

Standard implementation of hikari.api.special_endpoints.GuildOnboardingPromptOptionBuilder.

channel_ids property #

The prompt's title.

description property #

description: UndefinedOr[str]

The prompt's title.

emoji property #

Emoji which should appear on this option.

role_ids property #

The prompt's title.

title property #

title: str

The prompt's title.

build #

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 #

set_channel_ids(
    channel_ids: SnowflakeishSequence[GuildChannel],
) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_description #

set_description(description: UndefinedOr[str]) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_emoji #

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: UndefinedOr[Snowflakeish | Emoji | str]

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_role_ids #

set_role_ids(role_ids: SnowflakeishSequence[Role]) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

set_title #

set_title(title: str) -> Self

Set this prompt's title.

RETURNS DESCRIPTION
GuildOnboardingPromptBuilder

The guild onboarding builder.

GuildThreadIterator #

GuildThreadIterator(
    deserialize: _ThreadDeserializeSig[
        _GuildThreadChannelT
    ],
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    route: CompiledRoute,
    before: UndefinedOr[str],
    *,
    before_is_timestamp: bool,
)

Bases: BufferedLazyIterator[_GuildThreadChannelT]

Iterator implemented for guild thread endpoints.

InteractionAutocompleteBuilder #

Bases: InteractionAutocompleteBuilder

Standard implementation of hikari.api.special_endpoints.InteractionAutocompleteBuilder.

choices property #

Autocomplete choices.

type property #

Type of this response.

build #

Build a JSON object from this builder.

PARAMETER DESCRIPTION
entity_factory

The entity factory to use to serialize entities within this builder.

TYPE: EntityFactory

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.

set_choices #

set_choices(
    choices: Sequence[AutocompleteChoiceBuilder],
) -> Self

Set autocomplete choices.

PARAMETER DESCRIPTION
choices

The choices to set.

TYPE: Sequence[AutocompleteChoiceBuilder]

RETURNS DESCRIPTION
InteractionAutocompleteBuilder

Object of this builder.

InteractionDeferredBuilder #

Bases: InteractionDeferredBuilder

Standard implementation of hikari.api.special_endpoints.InteractionDeferredBuilder.

PARAMETER DESCRIPTION
type

The type of interaction response this is.

TYPE: DeferredResponseTypesT

flags property #

Message flags this response should have.

type property #

Type of this response.

build #

Build a JSON object from this builder.

PARAMETER DESCRIPTION
entity_factory

The entity factory to use to serialize entities within this builder.

TYPE: EntityFactory

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.

set_flags #

set_flags(flags: UndefinedType | int | MessageFlag) -> Self

Set message flags for this response.

PARAMETER DESCRIPTION
flags

The message flags to set for this response.

TYPE: UndefinedType | int | MessageFlag

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder.

InteractionMessageBuilder #

Bases: InteractionMessageBuilder

Standard implementation of hikari.api.special_endpoints.InteractionMessageBuilder.

PARAMETER DESCRIPTION
type

The type of interaction response this is.

TYPE: MessageResponseTypesT

content

The content of this response, if supplied. This follows the same rules as "content" on create message.

TYPE: UndefinedOr[str]

attachments property #

Sequence of up to 10 attachments to send with the message.

components property #

Sequence of up to 5 component builders to send in this response.

content property #

content: UndefinedNoneOr[str]

Response's message content.

embeds property #

Sequence of up to 10 of the embeds included in this response.

flags property #

Message flags this response should have.

is_tts property #

is_tts: UndefinedOr[bool]

Whether this response's content should be treated as text-to-speech.

mentions_everyone property #

mentions_everyone: UndefinedOr[bool]

Whether @everyone and @here mentions should be enabled for this response.

poll property #

The poll to include with this response.

role_mentions property #

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.

type property #

Type of this response.

user_mentions property #

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 #

add_attachment(attachment: Resourceish) -> Self

Add an attachment to this response.

PARAMETER DESCRIPTION
attachment

The attachment to add.

TYPE: Resourceish

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder.

add_component #

add_component(component: ComponentBuilder) -> Self

Add a component to this response.

PARAMETER DESCRIPTION
component

The component builder to add to this response.

TYPE: ComponentBuilder

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder.

add_embed #

add_embed(embed: Embed) -> Self

Add an embed to this response.

PARAMETER DESCRIPTION
embed

Object of the embed to add to this response.

TYPE: Embed

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

build #

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: EntityFactory

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.

clear_attachments #

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 #

clear_components() -> Self

Clear the components set for this response.

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

clear_content #

clear_content() -> Self

clear_embeds #

clear_embeds() -> Self

Clear the embeds set for this embed.

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_content #

set_content(content: UndefinedOr[str]) -> Self

Set the response's message content.

PARAMETER DESCRIPTION
content

The message content to set for this response.

TYPE: UndefinedOr[str]

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_flags #

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: UndefinedType | int | MessageFlag

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_mentions_everyone #

set_mentions_everyone(
    state: 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: UndefinedOr[bool] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_poll #

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 hikari.undefined.UNDEFINED to remove a previously added poll.

TYPE: UndefinedOr[PollBuilder]

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_role_mentions #

set_role_mentions(
    role_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, False or hikari.undefined.UNDEFINED to disallow any role mentions or True to allow all role mentions.

TYPE: UndefinedOr[SnowflakeishSequence[PartialRole] | bool] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_tts #

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: UndefinedOr[bool]

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_user_mentions #

set_user_mentions(
    user_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, False or hikari.undefined.UNDEFINED to disallow any user mentions or True to allow all user mentions.

TYPE: UndefinedOr[SnowflakeishSequence[PartialUser] | bool] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

InteractionModalBuilder #

Bases: InteractionModalBuilder

Standard implementation of hikari.api.special_endpoints.InteractionModalBuilder.

components property #

Sequence of component builders to send in this modal.

custom_id property #

custom_id: str

Developer set custom ID used for identifying interactions with this modal.

title property #

title: str

Title that will show up in the modal.

type property #

type: Literal[MODAL]

Type of this response.

add_component #

add_component(component: ComponentBuilder) -> Self

Add a component to this modal.

PARAMETER DESCRIPTION
component

The component builder to add to this modal.

TYPE: ComponentBuilder

build #

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: EntityFactory

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.

set_custom_id #

set_custom_id(custom_id: str) -> Self

Set the custom ID used for identifying interactions with this modal.

PARAMETER DESCRIPTION
custom_id

The developer set custom ID used for identifying interactions with this modal.

TYPE: str

set_title #

set_title(title: str) -> Self

Set the title that will show up in the modal.

PARAMETER DESCRIPTION
title

The title that will show up in the modal.

TYPE: str

InteractiveButtonBuilder #

Bases: _ButtonBuilder, InteractiveButtonBuilder

Builder class for interactive buttons.

custom_id property #

custom_id: str

Developer set custom ID used for identifying interactions with this button.

style property #

style: int | ButtonStyle

Button's style.

build #

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.

set_custom_id #

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: str

RETURNS DESCRIPTION
InteractiveButtonBuilder

The builder object to enable chained calls.

LinkButtonBuilder #

Bases: _ButtonBuilder, LinkButtonBuilder

Builder class for link buttons.

style property #

style: Literal[LINK]

Button's style.

url property #

url: str

URL this button should link to when pressed.

build #

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.

MediaGalleryComponentBuilder #

Bases: MediaGalleryComponentBuilder

Standard implementation of hikari.api.special_endpoints.MediaGalleryComponentBuilder.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

items property #

The items in the media gallery.

type property #

Type of component this builder represents.

add_item #

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: MediaGalleryItemBuilder

RETURNS DESCRIPTION
MediaGalleryComponentBuilder

The builder object to enable chained calls.

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: Resourceish

description

The description for the media gallery item.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

spoiler

Whether the media has a spoiler.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
MediaGalleryComponentBuilder

The builder object to enable chained calls.

build #

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.

MediaGalleryItemBuilder #

Bases: MediaGalleryItemBuilder

Standard implementation of hikari.api.special_endpoints.MediaGalleryItemBuilder.

description property #

description: UndefinedOr[str]

The description for the media gallery item.

is_spoiler property #

is_spoiler: bool

Whether the media is marked as a spoiler.

media property #

media: Resourceish

The media for the gallery item.

build #

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.

MemberIterator #

MemberIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    guild: SnowflakeishOr[PartialGuild],
    *,
    first_id: UndefinedOr[str] = UNDEFINED,
)

Bases: BufferedLazyIterator['guilds.Member']

Implementation of an iterator for retrieving members in a guild.

MessageActionRowBuilder #

Bases: MessageActionRowBuilder

Standard implementation of hikari.api.special_endpoints.MessageActionRowBuilder.

components property #

Sequence of the component builders registered within this action row.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

type property #

Type of component this builder represents.

add_channel_menu #

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: str

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: Sequence[ChannelType] DEFAULT: ()

placeholder

Placeholder text to show when no entries have been selected.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

min_values

The minimum amount of entries which need to be selected.

TYPE: int DEFAULT: 0

max_values

The maximum amount of entries which can be selected.

TYPE: int DEFAULT: 1

is_disabled

Whether this select menu should be marked as disabled.

TYPE: bool DEFAULT: False

id

The ID to give to the menu.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ActionRowBuilder

The action row builder to enable chained calls.

RAISES DESCRIPTION
ValueError

If an invalid select menu type is passed.

add_component #

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.

TYPE: MessageActionRowBuilderComponentsT

RETURNS DESCRIPTION
ActionRowBuilder

The builder object to enable chained calls.

add_interactive_button #

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: InteractiveButtonTypesT

custom_id

The developer-defined custom identifier used to identify which button triggered component interactions.

TYPE: str

emoji

The button's display emoji.

TYPE: Snowflakeish | Emoji | str | UndefinedType DEFAULT: UNDEFINED

label

The button's display label.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

is_disabled

Whether the button should be marked as disabled.

TYPE: bool DEFAULT: False

id

The ID to give to the button.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ActionRowBuilder

The action row builder to enable chained calls.

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: str

emoji

The button's display emoji.

TYPE: Snowflakeish | Emoji | str | UndefinedType DEFAULT: UNDEFINED

label

The button's display label.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

is_disabled

Whether the button should be marked as disabled.

TYPE: bool DEFAULT: False

id

The ID to give to the button.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ActionRowBuilder

The action row builder to enable chained calls.

add_premium_button #

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: int

id

The ID to give to the button.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
ActionRowBuilder

The action row builder to enable chained calls.

add_select_menu #

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: ComponentType | int

custom_id

A developer-defined custom identifier used to identify which menu triggered component interactions.

TYPE: str

placeholder

Placeholder text to show when no entries have been selected.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

min_values

The minimum amount of entries which need to be selected.

TYPE: int DEFAULT: 0

max_values

The maximum amount of entries which can be selected.

TYPE: int DEFAULT: 1

is_disabled

Whether this select menu should be marked as disabled.

TYPE: bool DEFAULT: False

id

The ID to give to the menu.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

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 #

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: str

placeholder

Placeholder text to show when no entries have been selected.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

min_values

The minimum amount of entries which need to be selected.

TYPE: int DEFAULT: 0

max_values

The maximum amount of entries which can be selected.

TYPE: int DEFAULT: 1

is_disabled

Whether this select menu should be marked as disabled.

TYPE: bool DEFAULT: False

id

The ID to give to the menu.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
TextSelectMenuBuilder

The text select menu builder.

hikari.api.special_endpoints.TextSelectMenuBuilder.add_option should be called to add options to the returned builder then hikari.api.special_endpoints.TextSelectMenuBuilder.parent can be used to return to this action row while chaining calls.

RAISES DESCRIPTION
ValueError

If an invalid select menu type is passed.

build #

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.

MessageIterator #

MessageIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    channel: SnowflakeishOr[TextableChannel],
    direction: str,
    first_id: UndefinedOr[str],
)

Bases: BufferedLazyIterator['messages.Message']

Implementation of an iterator for message history.

ModalActionRowBuilder #

Bases: ModalActionRowBuilder

Standard implementation of hikari.api.special_endpoints.ModalActionRowBuilder.

components property #

Sequence of the component builders registered within this action row.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

type property #

Type of component this builder represents.

add_component #

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.

TYPE: ModalActionRowBuilderComponentsT

RETURNS DESCRIPTION
ActionRowBuilder

The builder object to enable chained calls.

add_text_input #

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: str

label

Label above this text input.

TYPE: str

style

The text input's style.

TYPE: TextInputStyle DEFAULT: SHORT

placeholder

Placeholder text to display when the text input is empty.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

value

Default text to pre-fill the field with.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

required

Whether text must be supplied for this text input.

TYPE: bool DEFAULT: True

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: int DEFAULT: 0

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: int DEFAULT: 4000

RETURNS DESCRIPTION
ModalActionRowBuilder

The modal action row builder to enable call chaining.

build #

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.

OwnGuildIterator #

OwnGuildIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    *,
    newest_first: bool,
    first_id: str,
)

Bases: BufferedLazyIterator['applications.OwnGuild']

Implementation of an iterator for retrieving guilds you are in.

PinnedMessageIterator #

PinnedMessageIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    channel: SnowflakeishOr[TextableChannel],
    first_id: UndefinedOr[str],
)

Bases: BufferedLazyIterator['messages.PinnedMessage']

Implementation of an iterator for message history.

PollAnswerBuilder #

Bases: PollAnswerBuilder

Standard implementation of hikari.api.special_endpoints.PollAnswerBuilder.

emoji property #

The emoji for the media object.

text property #

The text for the media object.

build #

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: PollBuilder

Standard implementation of hikari.api.special_endpoints.PollBuilder.

allow_multiselect property #

allow_multiselect: bool

Whether a user can select multiple answers.

answers property #

The answers for the poll.

duration property #

duration: UndefinedOr[int]

The duration of the poll in hours.

layout_type property #

The layout type for the poll.

question_text property #

question_text: str

The question text for the poll.

add_answer #

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: UndefinedOr[str] DEFAULT: UNDEFINED

emoji

The emoji for the answer.

TYPE: UndefinedOr[Emoji] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
PollAnswerBuilder

The builder object to enable chained calls.

build #

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, PremiumButtonBuilder

Builder class for premium buttons.

sku_id property #

sku_id: int

The SKU ID this button should link to when pressed.

style property #

style: Literal[PREMIUM]

Button's style.

build #

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.

ReactorIterator #

ReactorIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    channel: SnowflakeishOr[TextableChannel],
    message: SnowflakeishOr[PartialMessage],
    emoji: str,
    reaction_type: UndefinedOr[ReactionType] = UNDEFINED,
)

Bases: BufferedLazyIterator['users.User']

Implementation of an iterator for the users who reacted to a message.

RepositionedChannel #

Bases: RepositionedChannel

Standard implementation of hikari.api.special_endpoints.RepositionedChannel.

channel property #

Channel property.

lock_permissions property #

lock_permissions: UndefinedOr[bool]

Lock permissions property.

parent property #

Parent property.

position property #

position: int

Position property.

set_channel #

set_channel(channel: SnowflakeishOr[GuildChannel]) -> Self

Set the channel.

RETURNS DESCRIPTION
RepositionedChannel

The reposition channel helper.

set_lock_permissions #

set_lock_permissions(lock: UndefinedOr[bool]) -> Self

Set the lock.

RETURNS DESCRIPTION
RepositionedChannel

The reposition channel helper.

set_parent #

set_parent(
    parent: UndefinedOr[SnowflakeishOr[GuildCategory]],
) -> Self

Set the parent.

RETURNS DESCRIPTION
RepositionedChannel

The reposition channel helper.

set_position #

set_position(position: int) -> Self

Set the position.

RETURNS DESCRIPTION
RepositionedChannel

The reposition channel helper.

ScheduledEventUserIterator #

ScheduledEventUserIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    guild: SnowflakeishOr[PartialGuild],
    event: SnowflakeishOr[ScheduledEvent],
    *,
    first_id: str,
    newest_first: bool,
)

Bases: BufferedLazyIterator['scheduled_events.ScheduledEventUser']

Implementation of an iterator for retrieving the users subscribed to a scheduled event.

SectionComponentBuilder #

Bases: SectionComponentBuilder

Standard implementation of hikari.api.special_endpoints.SectionComponentBuilder.

accessory property #

The accessory attached to the section.

components property #

The components attached to the section.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

type property #

Type of component this builder represents.

add_component #

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.

TYPE: SectionBuilderComponentsT

RETURNS DESCRIPTION
SectionComponentBuilder

The builder object to enable chained calls.

add_text_display #

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: str

id

The ID to give to the text display.

If not provided, auto populated through increment.

TYPE: UndefinedOr[int] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
SectionComponentBuilder

The builder object to enable chained calls.

build #

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.

SelectMenuBuilder #

Bases: SelectMenuBuilder

Builder class for select menus.

custom_id property #

custom_id: str

Developer set custom ID used for identifying interactions with this menu.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

is_disabled property #

is_disabled: bool

Whether the select menu should be marked as disabled.

max_values 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 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 property #

placeholder: UndefinedOr[str]

Placeholder text to display when no options are selected.

type property #

Type of component this builder represents.

build #

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.

set_custom_id #

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: str

RETURNS DESCRIPTION
SelectMenuBuilder

The builder object to enable chained calls.

set_is_disabled #

set_is_disabled(state: bool) -> Self

Set whether this option is disabled.

PARAMETER DESCRIPTION
state

Whether this option is disabled.

TYPE: bool

RETURNS DESCRIPTION
SelectMenuBuilder

The builder object to enable chained calls.

set_max_values #

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: int

RETURNS DESCRIPTION
SelectMenuBuilder

The builder object to enable chained calls.

set_min_values #

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: int

RETURNS DESCRIPTION
SelectMenuBuilder

The builder object to enable chained calls.

set_placeholder #

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: UndefinedOr[str]

RETURNS DESCRIPTION
SelectMenuBuilder

The builder object to enable chained calls.

SelectOptionBuilder #

Bases: SelectOptionBuilder

Builder class for select menu options.

description property #

description: UndefinedOr[str]

Description of the option, max 100 characters.

emoji property #

Emoji which should appear on this option.

is_default property #

is_default: bool

Whether this option should be marked as selected by default.

label property #

label: str

User-facing name of the option, max 100 characters.

value property #

value: str

Developer-defined value of the option, max 100 characters.

build #

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 #

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: UndefinedOr[str]

RETURNS DESCRIPTION
SelectOptionBuilder

The builder object to enable chained calls.

set_emoji #

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: Snowflakeish | Emoji | str | UndefinedType

RETURNS DESCRIPTION
SelectOptionBuilder

The builder object to enable chained calls.

set_is_default #

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: bool

RETURNS DESCRIPTION
SelectOptionBuilder

The builder object to enable chained calls.

set_label #

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: str

RETURNS DESCRIPTION
SelectOptionBuilder

The builder object to enable chained calls.

set_value #

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: str

RETURNS DESCRIPTION
SelectOptionBuilder

The builder object to enable chained calls.

SeparatorComponentBuilder #

Bases: SeparatorComponentBuilder

Standard implementation of hikari.api.special_endpoints.SeparatorComponentBuilder.

divider property #

divider: UndefinedOr[bool]

Whether the separator has a divider.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

spacing property #

The spacing for the separator.

type property #

Type of component this builder represents.

build #

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.

SlashCommandBuilder #

Bases: CommandBuilder, SlashCommandBuilder

Builder class for slash commands.

description property #

description: str

Command's description.

Warning

This should be inclusively between 1-100 characters in length.

description_localizations property #

description_localizations: Mapping[Locale | str, str]

Command's localised descriptions.

options property #

Sequence of up to 25 of the options set for this command.

type property #

Type of this command.

add_option #

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: CommandOption

RETURNS DESCRIPTION
SlashCommandBuilder

Object of this command builder to allow for chained calls.

build #

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: EntityFactory

RETURNS DESCRIPTION
MutableMapping[str, Any]

The built json object representation of this builder.

create async #

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: RESTClient

application

The application to create this command for.

TYPE: SnowflakeishOr[PartialApplication]

guild

The guild to create this command for.

If left undefined then this command will be declared globally.

TYPE: UndefinedOr[SnowflakeishOr[PartialGuild]] DEFAULT: UNDEFINED

RETURNS DESCRIPTION
SlashCommand

The created command.

set_description #

set_description(description: str) -> Self

Set the description for this command.

PARAMETER DESCRIPTION
description

The description to set for this command.

TYPE: str

RETURNS DESCRIPTION
SlashCommandBuilder

Object of this command builder.

set_description_localizations #

set_description_localizations(
    description_localizations: Mapping[Locale | str, str],
) -> Self

Set the localised descriptions for this command.

PARAMETER DESCRIPTION
description_localizations

The description localizations to set for this command.

TYPE: Mapping[Locale | str, str]

RETURNS DESCRIPTION
SlashCommandBuilder

Object of this command builder.

TextDisplayComponentBuilder #

Bases: TextDisplayComponentBuilder

Standard implementation of hikari.api.special_endpoints.TextDisplayComponentBuilder.

content property #

content: str

The content for the text display.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

type property #

Type of component this builder represents.

build #

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.

TextInputBuilder #

Bases: TextInputBuilder

Standard implementation of hikari.api.special_endpoints.TextInputBuilder.

custom_id 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.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

is_required property #

is_required: bool

Whether this text input is required to be filled-in.

label property #

label: str

Label above this text input.

max_length property #

max_length: int

Maximum length the text should have.

min_length property #

min_length: int

Minimum length the text should have.

placeholder property #

placeholder: UndefinedOr[str]

Placeholder text for when the text input is empty.

style property #

Style to use for the text input.

type property #

Type of component this builder represents.

value property #

value: UndefinedOr[str]

Pre-filled text that will be sent if the user does not write anything.

build #

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.

set_custom_id #

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: str

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

set_label #

set_label(label: str) -> Self

Set the label above this text input.

PARAMETER DESCRIPTION
label

Label above this text input.

TYPE: str

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

set_max_length #

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: int

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

set_min_length #

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: int

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

set_placeholder #

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: UndefinedOr[str]

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

set_required #

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: bool

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

set_style #

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: TextInputStyle | int

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

set_value #

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: UndefinedOr[str]

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

TextSelectMenuBuilder #

TextSelectMenuBuilder(
    *,
    id: UndefinedOr[int] = UNDEFINED,
    custom_id: str,
    parent: _ParentT,
    options: Sequence[SelectOptionBuilder] = (),
    placeholder: UndefinedOr[str] = UNDEFINED,
    min_values: int = 0,
    max_values: int = 1,
    is_disabled: bool = False,
)
TextSelectMenuBuilder(
    *,
    id: UndefinedOr[int] = UNDEFINED,
    custom_id: str,
    options: Sequence[SelectOptionBuilder] = (),
    placeholder: UndefinedOr[str] = UNDEFINED,
    min_values: int = 0,
    max_values: int = 1,
    is_disabled: bool = False,
)
TextSelectMenuBuilder(
    *,
    id: UndefinedOr[int] = UNDEFINED,
    custom_id: str,
    parent: _ParentT | None = None,
    options: Sequence[SelectOptionBuilder] = (),
    placeholder: UndefinedOr[str] = UNDEFINED,
    min_values: int = 0,
    max_values: int = 1,
    is_disabled: bool = False,
)

Bases: SelectMenuBuilder, TextSelectMenuBuilder[_ParentT]

Builder class for text select menus.

options property #

Sequence of the options set for this select menu.

parent property #

parent: _ParentT

Parent object which initialised this builder.

add_option #

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: str

value

The developer defined value of this option, max 100 characters.

TYPE: str

description

The option's description.

This can be up to 100 characters long.

TYPE: UndefinedOr[str] DEFAULT: UNDEFINED

emoji

The option's display emoji.

TYPE: Snowflakeish | Emoji | str | UndefinedType DEFAULT: UNDEFINED

is_default

Whether this option should be selected by default.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
TextSelectMenuBuilder

The select menu builder to enable call chaining.

add_raw_option #

add_raw_option(option: SelectOptionBuilder) -> Self

build #

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.

ThreadMembersIterator #

ThreadMembersIterator(
    entity_factory: EntityFactory,
    request_call: _RequestCallSig,
    channel: SnowflakeishOr[TextableChannel],
    last_id: UndefinedOr[Snowflakeish],
)

Bases: BufferedLazyIterator['channels.ThreadMember']

Implementation of an iterator for thread members.

ThumbnailComponentBuilder #

Bases: ThumbnailComponentBuilder

Standard implementation of hikari.api.special_endpoints.ThumbnailComponentBuilder.

description property #

description: UndefinedOr[str]

The description for the thumbnails media.

id property #

ID of the component.

It will be used to order components in the layout.

If not provided, it will be auto populated through increment.

is_spoiler property #

is_spoiler: bool

Whether the media is marked as a spoiler.

media property #

media: Resourceish

The media of this thumbnail.

type property #

Type of component this builder represents.

build #

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.

TypingIndicator #

TypingIndicator(
    request_call: _RequestCallSig,
    channel: SnowflakeishOr[TextableChannel],
    rest_close_event: Event,
)

Bases: TypingIndicator

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.