Skip to content

hikari.api.special_endpoints#

Special additional endpoints used by the REST API.

AutocompleteChoiceBuilder #

Bases: ABC

Interface of an autocomplete choice used to respond to interactions.

name abstractmethod property #

name: str

The choice's name.

value abstractmethod property #

value: Union[int, str, float]

The choice's value.

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_value(value: Union[int, float, str]) -> Self

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

style abstractmethod property #

Button's style.

type abstractmethod property #

type: Literal[BUTTON]

Type of component this builder represents.

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_emoji abstractmethod #

set_emoji(emoji: Union[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: Union[Snowflakeish, Emoji, str, UndefinedType]

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

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

RETURNS DESCRIPTION
ButtonBuilder

The builder object to enable chained calls.

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.

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.

type abstractmethod property #

Type of component this builder represents.

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

RETURNS DESCRIPTION
SelectMenuBuilder

The builder object to enable chained calls.

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

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

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

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

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

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.

default_member_permissions abstractmethod property #

default_member_permissions: Union[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 abstractmethod property #

ID of this command.

is_dm_enabled abstractmethod property #

is_dm_enabled: UndefinedOr[bool]

Whether this command is enabled in DMs with the bot.

Only applicable to globally-scoped commands.

is_nsfw abstractmethod property #

is_nsfw: UndefinedOr[bool]

Whether this command age-restricted.

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: Mapping[Union[Locale, str], str]

Name localizations set for this command.

type abstractmethod property #

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

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.UNDEFINED,
) -> PartialCommand

Create this command through a REST call.

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]

PARAMETER DESCRIPTION
guild

The guild to create this command for.

If left undefined then this command will be declared globally.

TYPE: UndefinedOr[SnowflakeishOr[PartialGuild]]

RETURNS DESCRIPTION
PartialCommand

The created command.

set_default_member_permissions abstractmethod #

set_default_member_permissions(
    default_member_permissions: Union[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: UndefinedOr[bool]

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

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

set_is_dm_enabled abstractmethod #

set_is_dm_enabled(state: UndefinedOr[bool]) -> Self

Set whether this command will be enabled in DMs with the bot.

PARAMETER DESCRIPTION
state

Whether this command is enabled in DMs with the bot.

TYPE: UndefinedOr[bool]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

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

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

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

set_name_localizations abstractmethod #

set_name_localizations(
    name_localizations: Mapping[Union[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[Union[Locale, str], str]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder.

ComponentBuilder #

Bases: ABC

Base class for all component builder classes.

type abstractmethod property #

Type of component this builder represents.

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.

ContextMenuCommandBuilder #

Bases: CommandBuilder

ContextMenuCommandBuilder.

default_member_permissions abstractmethod property #

default_member_permissions: Union[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 abstractmethod property #

ID of this command.

is_dm_enabled abstractmethod property #

is_dm_enabled: UndefinedOr[bool]

Whether this command is enabled in DMs with the bot.

Only applicable to globally-scoped commands.

is_nsfw abstractmethod property #

is_nsfw: UndefinedOr[bool]

Whether this command age-restricted.

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: Mapping[Union[Locale, str], str]

Name localizations set for this command.

type abstractmethod property #

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

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

application

The application to create this command for.

TYPE: SnowflakeishOr[PartialApplication]

PARAMETER DESCRIPTION
guild

The guild to create this command for.

If left undefined then this command will be declared globally.

TYPE: UndefinedOr[SnowflakeishOr[PartialGuild]]

RETURNS DESCRIPTION
ContextMenuCommand

The created command.

set_default_member_permissions abstractmethod #

set_default_member_permissions(
    default_member_permissions: Union[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: UndefinedOr[bool]

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

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

set_is_dm_enabled abstractmethod #

set_is_dm_enabled(state: UndefinedOr[bool]) -> Self

Set whether this command will be enabled in DMs with the bot.

PARAMETER DESCRIPTION
state

Whether this command is enabled in DMs with the bot.

TYPE: UndefinedOr[bool]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

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

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

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

set_name_localizations abstractmethod #

set_name_localizations(
    name_localizations: Mapping[Union[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[Union[Locale, str], str]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder.

GuildBuilder #

Bases: ABC

Result type of hikari.api.rest.RESTClient.guild_builder.

This is used to create a guild in a tidy way using the HTTP API, since the logic behind creating a guild on an API level is somewhat confusing and detailed.

Note

If you call hikari.api.special_endpoints.GuildBuilder.add_role, the default roles provided by Discord will be created. This also applies to the add_ functions for text channels/voice channels/categories.

Note

Functions that return a hikari.snowflakes.Snowflake do not provide the final ID that the object will have once the API call is made. The returned IDs are only able to be used to re-reference particular objects while building the guild format to allow for the creation of channels within categories, and to provide permission overwrites.

Examples:

Creating an empty guild:

    guild = await rest.guild_builder("My Server!").create()

Creating a guild with an icon:

    from hikari.files import WebResourceStream

    guild_builder = rest.guild_builder("My Server!")
    guild_builder.icon = WebResourceStream("cat.png", "http://...")
    guild = await guild_builder.create()

Adding roles to your guild:

    from hikari.permissions import Permissions

    guild_builder = rest.guild_builder("My Server!")

    everyone_role_id = guild_builder.add_role("@everyone")
    admin_role_id = guild_builder.add_role("Admins", permissions=Permissions.ADMINISTRATOR)

    await guild_builder.create()

Warning

The first role must always be the @everyone role.

Adding a text channel to your guild:

    guild_builder = rest.guild_builder("My Server!")

    category_id = guild_builder.add_category("My safe place")
    channel_id = guild_builder.add_text_channel("general", parent_id=category_id)

    await guild_builder.create()

default_message_notifications abstractmethod property writable #

default_message_notifications: UndefinedOr[GuildMessageNotificationsLevel]

Default message notification level that can be overwritten.

If not overridden, this will use the Discord default level.

explicit_content_filter_level abstractmethod property writable #

explicit_content_filter_level: UndefinedOr[GuildExplicitContentFilterLevel]

Explicit content filter level that can be overwritten.

If not overridden, this will use the Discord default level.

icon abstractmethod property writable #

Guild icon to use that can be overwritten.

If not overridden, the guild will not have an icon.

name abstractmethod property #

name: str

Name of the guild to create.

verification_level abstractmethod property writable #

Verification level required to join the guild.

add_category abstractmethod #

add_category(
    name: str,
    /,
    *,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Collection[PermissionOverwrite]
    ] = undefined.UNDEFINED,
) -> Snowflake

Create a category channel.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the category.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the category.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

RETURNS DESCRIPTION
Snowflake

The dummy ID for this channel that can be used temporarily to refer to this object while designing the guild layout.

When the guild is created, this will be replaced with a different ID.

add_role abstractmethod #

add_role(
    name: str,
    /,
    *,
    permissions: UndefinedOr[Permissions] = undefined.UNDEFINED,
    color: UndefinedOr[Colorish] = undefined.UNDEFINED,
    colour: UndefinedOr[Colorish] = undefined.UNDEFINED,
    hoist: UndefinedOr[bool] = undefined.UNDEFINED,
    mentionable: UndefinedOr[bool] = undefined.UNDEFINED,
    position: UndefinedOr[int] = undefined.UNDEFINED,
) -> Snowflake

Create a role.

Warning

The first role you create (i.e., position 0) must always be the @everyone role.

PARAMETER DESCRIPTION
name

The role's name.

TYPE: str

PARAMETER DESCRIPTION
permissions

If provided, the permissions for the role.

TYPE: UndefinedOr[Permissions]

color

If provided, the role's color.

TYPE: UndefinedOr[Colorish]

colour

An alias for color.

TYPE: UndefinedOr[Colorish]

hoist

If provided, whether to hoist the role.

TYPE: UndefinedOr[bool]

mentionable

If provided, whether to make the role mentionable.

TYPE: UndefinedOr[bool]

position

If provided, the position of the role.

TYPE: UndefinedOr[int]

RETURNS DESCRIPTION
Snowflake

The dummy ID for this role that can be used temporarily to refer to this object while designing the guild layout.

When the guild is created, this will be replaced with a different ID.

RAISES DESCRIPTION
ValueError

If you are defining the first role, but did not name it @everyone.

TypeError

If you specify both color and colour together or if you try to specify color, colour, hoisted, mentionable or position for the @everyone role.

add_stage_channel abstractmethod #

add_stage_channel(
    name: str,
    /,
    *,
    parent_id: UndefinedOr[Snowflake] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Collection[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedNoneOr[Union[VoiceRegion, str]],
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
) -> Snowflake

Create a stage channel.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

parent_id

The ID of the category to create the channel under.

TYPE: UndefinedOr[Snowflake]

RETURNS DESCRIPTION
Snowflake

The dummy ID for this channel that can be used temporarily to refer to this object while designing the guild layout.

When the guild is created, this will be replaced with a different ID.

add_text_channel abstractmethod #

add_text_channel(
    name: str,
    /,
    *,
    parent_id: UndefinedOr[Snowflake] = undefined.UNDEFINED,
    topic: UndefinedOr[str] = undefined.UNDEFINED,
    rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Collection[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    nsfw: UndefinedOr[bool] = undefined.UNDEFINED,
) -> Snowflake

Create a text channel.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

topic

If provided, the channels topic. Maximum 1024 characters.

TYPE: UndefinedOr[str]

nsfw

If provided, whether to mark the channel as NSFW.

TYPE: UndefinedOr[bool]

rate_limit_per_user

If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds.

TYPE: UndefinedOr[int]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

parent_id

The ID of the category to create the channel under.

TYPE: UndefinedOr[Snowflake]

RETURNS DESCRIPTION
Snowflake

The dummy ID for this channel that can be used temporarily to refer to this object while designing the guild layout.

When the guild is created, this will be replaced with a different ID.

add_voice_channel abstractmethod #

add_voice_channel(
    name: str,
    /,
    *,
    parent_id: UndefinedOr[Snowflake] = undefined.UNDEFINED,
    bitrate: UndefinedOr[int] = undefined.UNDEFINED,
    video_quality_mode: UndefinedOr[
        Union[VideoQualityMode, int]
    ] = undefined.UNDEFINED,
    position: UndefinedOr[int] = undefined.UNDEFINED,
    permission_overwrites: UndefinedOr[
        Collection[PermissionOverwrite]
    ] = undefined.UNDEFINED,
    region: UndefinedNoneOr[Union[VoiceRegion, str]],
    user_limit: UndefinedOr[int] = undefined.UNDEFINED,
) -> Snowflake

Create a voice channel.

PARAMETER DESCRIPTION
name

The channels name. Must be between 2 and 1000 characters.

TYPE: str

PARAMETER DESCRIPTION
position

If provided, the position of the channel (relative to the category, if any).

TYPE: UndefinedOr[int]

user_limit

If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit.

TYPE: UndefinedOr[int]

bitrate

If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers.

TYPE: UndefinedOr[int]

video_quality_mode

If provided, the new video quality mode for the channel.

TYPE: UndefinedOr[Union[VideoQualityMode, int]]

permission_overwrites

If provided, the permission overwrites for the channel.

TYPE: UndefinedOr[Sequence[PermissionOverwrite]]

region

If provided, the voice region to for this channel. Passing None here will set it to "auto" mode where the used region will be decided based on the first person who connects to it when it's empty.

TYPE: UndefinedOr[Union[VoiceRegion, str]]

parent_id

The ID of the category to create the channel under.

TYPE: UndefinedOr[Snowflake]

RETURNS DESCRIPTION
Snowflake

The dummy ID for this channel that can be used temporarily to refer to this object while designing the guild layout.

When the guild is created, this will be replaced with a different ID.

create abstractmethod async #

create() -> RESTGuild

Send the request to Discord to create the guild.

The application user will be added to this guild as soon as it is created. All IDs that were provided when building this guild will become invalid and will be replaced with real IDs.

RETURNS DESCRIPTION
RESTGuild

The created guild.

RAISES DESCRIPTION
BadRequestError

If any values set in the guild builder are invalid.

UnauthorizedError

If you are unauthorized to make the request (invalid/missing token).

ForbiddenError

If you are already in 10 guilds.

InternalServerError

If an internal error occurs on Discord while handling the request.

InteractionAutocompleteBuilder #

Bases: InteractionResponseBuilder, ABC

Interface of an autocomplete interaction response builder.

choices abstractmethod property #

Autocomplete choices.

type abstractmethod property #

Type of this response.

build abstractmethod #

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

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: InteractionResponseBuilder, ABC

Interface of a deferred message interaction response builder.

flags abstractmethod property #

Message flags this response should have.

type abstractmethod property #

Type of this response.

build abstractmethod #

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

set_flags(flags: Union[UndefinedType, int, MessageFlag]) -> Self

Set message flags for this response.

PARAMETER DESCRIPTION
flags

The message flags to set for this response.

TYPE: Union[UndefinedType, int, MessageFlag]

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 #

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

components abstractmethod property #

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

content abstractmethod property #

content: UndefinedNoneOr[str]

Response's message content.

embeds abstractmethod property #

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

flags abstractmethod property #

Message flags this response should have.

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.

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

Type of this response.

user_mentions abstractmethod 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 abstractmethod #

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

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

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

build abstractmethod #

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

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

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_flags abstractmethod #

set_flags(flags: Union[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: Union[UndefinedType, int, MessageFlag]

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_mentions_everyone abstractmethod #

set_mentions_everyone(
    mentions: UndefinedOr[bool] = undefined.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_role_mentions abstractmethod #

set_role_mentions(
    mentions: UndefinedOr[
        Union[SnowflakeishSequence[PartialRole], bool]
    ] = undefined.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[Union[SnowflakeishSequence[PartialUser], bool]] DEFAULT: UNDEFINED

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

RETURNS DESCRIPTION
InteractionMessageBuilder

Object of this builder to allow for chained calls.

set_user_mentions abstractmethod #

set_user_mentions(
    mentions: UndefinedOr[
        Union[SnowflakeishSequence[PartialUser], bool]
    ] = undefined.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[Union[SnowflakeishSequence[PartialUser], bool]] DEFAULT: UNDEFINED

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 #

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.

title abstractmethod property #

title: str

Title that will show up in the modal.

type abstractmethod property #

type: Literal[MODAL]

Type of this response.

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

build abstractmethod #

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

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

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

InteractionResponseBuilder #

Bases: ABC

Base class for all interaction response builders used in the interaction server.

type abstractmethod property #

Type of this response.

build abstractmethod #

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.

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.

emoji abstractmethod property #

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.

style abstractmethod property #

Button's style.

type abstractmethod property #

type: Literal[BUTTON]

Type of component this builder represents.

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

RETURNS DESCRIPTION
InteractiveButtonBuilder

The builder object to enable chained calls.

set_emoji abstractmethod #

set_emoji(emoji: Union[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: Union[Snowflakeish, Emoji, str, UndefinedType]

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

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

RETURNS DESCRIPTION
ButtonBuilder

The builder object to enable chained calls.

LinkButtonBuilder #

Bases: ButtonBuilder, ABC

Builder interface for link buttons.

emoji abstractmethod property #

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.

style abstractmethod property #

Button's style.

type abstractmethod property #

type: Literal[BUTTON]

Type of component this builder represents.

url abstractmethod property #

url: str

URL this button should link to when pressed.

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_emoji abstractmethod #

set_emoji(emoji: Union[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: Union[Snowflakeish, Emoji, str, UndefinedType]

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

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

RETURNS DESCRIPTION
ButtonBuilder

The builder object to enable chained calls.

MessageActionRowBuilder #

Bases: ComponentBuilder, ABC

Builder class for action row components.

components abstractmethod property #

Sequence of the component builders registered within this action row.

type abstractmethod property #

Type of component this builder represents.

add_channel_menu abstractmethod #

add_channel_menu(
    custom_id: str,
    /,
    *,
    channel_types: Sequence[ChannelType] = (),
    placeholder: UndefinedOr[str] = undefined.UNDEFINED,
    min_values: int = 0,
    max_values: int = 1,
    is_disabled: bool = False,
) -> 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

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: ComponentBuilder) -> 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: ComponentBuilder

RETURNS DESCRIPTION
ActionRowBuilder

The builder object to enable chained calls.

add_interactive_button abstractmethod #

add_interactive_button(
    style: InteractiveButtonTypesT,
    custom_id: str,
    /,
    *,
    emoji: Union[Snowflakeish, Emoji, str, UndefinedType] = undefined.UNDEFINED,
    label: UndefinedOr[str] = undefined.UNDEFINED,
    is_disabled: bool = False,
) -> 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: Union[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

RETURNS DESCRIPTION
ActionRowBuilder

The action row builder to enable chained calls.

add_link_button(
    url: str,
    /,
    *,
    emoji: Union[Snowflakeish, Emoji, str, UndefinedType] = undefined.UNDEFINED,
    label: UndefinedOr[str] = undefined.UNDEFINED,
    is_disabled: bool = False,
) -> 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: Union[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

RETURNS DESCRIPTION
ActionRowBuilder

The action row builder to enable chained calls.

add_select_menu abstractmethod #

add_select_menu(
    type_: Union[ComponentType, int],
    custom_id: str,
    /,
    *,
    placeholder: UndefinedOr[str] = undefined.UNDEFINED,
    min_values: int = 0,
    max_values: int = 1,
    is_disabled: bool = False,
) -> 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: Union[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

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.UNDEFINED,
    min_values: int = 0,
    max_values: int = 1,
    is_disabled: bool = False,
) -> 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

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

ModalActionRowBuilder #

Bases: ComponentBuilder, ABC

Builder class for modal action row components.

components abstractmethod property #

Sequence of the component builders registered within this action row.

type abstractmethod property #

Type of component this builder represents.

add_component abstractmethod #

add_component(component: ComponentBuilder) -> 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: ComponentBuilder

RETURNS DESCRIPTION
ActionRowBuilder

The builder object to enable chained calls.

add_text_input abstractmethod #

add_text_input(
    custom_id: str,
    label: str,
    /,
    *,
    style: TextInputStyle = components_.TextInputStyle.SHORT,
    placeholder: UndefinedOr[str] = undefined.UNDEFINED,
    value: UndefinedOr[str] = undefined.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 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.

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.

type abstractmethod property #

Type of component this builder represents.

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

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

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

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

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

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 which should appear on this option.

is_default abstractmethod property #

is_default: bool

Whether this option should be marked as selected by default.

label abstractmethod property #

label: str

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

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

RETURNS DESCRIPTION
SelectOptionBuilder

The builder object to enable chained calls.

set_emoji abstractmethod #

set_emoji(emoji: Union[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: Union[Snowflakeish, Emoji, str, UndefinedType]

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

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

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

RETURNS DESCRIPTION
SelectOptionBuilder

The builder object to enable chained calls.

SlashCommandBuilder #

Bases: CommandBuilder

SlashCommandBuilder.

default_member_permissions abstractmethod property #

default_member_permissions: Union[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.

description abstractmethod property #

description: str

Command's description.

Warning

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

description_localizations abstractmethod property #

description_localizations: Mapping[Union[Locale, str], str]

Command's localised descriptions.

id abstractmethod property #

ID of this command.

is_dm_enabled abstractmethod property #

is_dm_enabled: UndefinedOr[bool]

Whether this command is enabled in DMs with the bot.

Only applicable to globally-scoped commands.

is_nsfw abstractmethod property #

is_nsfw: UndefinedOr[bool]

Whether this command age-restricted.

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: Mapping[Union[Locale, str], str]

Name localizations set for this command.

options abstractmethod property #

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

type abstractmethod property #

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

RETURNS DESCRIPTION
SlashCommandBuilder

Object of this command builder to allow for chained calls.

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

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

application

The application to create this command for.

TYPE: SnowflakeishOr[PartialApplication]

PARAMETER DESCRIPTION
guild

The guild to create this command for.

If left undefined then this command will be declared globally.

TYPE: UndefinedOr[SnowflakeishOr[PartialGuild]]

RETURNS DESCRIPTION
SlashCommand

The created command.

set_default_member_permissions abstractmethod #

set_default_member_permissions(
    default_member_permissions: Union[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: UndefinedOr[bool]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder.

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

RETURNS DESCRIPTION
SlashCommandBuilder

Object of this command builder.

set_description_localizations abstractmethod #

set_description_localizations(
    description_localizations: Mapping[Union[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[Union[Locale, str], str]

RETURNS DESCRIPTION
SlashCommandBuilder

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

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

set_is_dm_enabled abstractmethod #

set_is_dm_enabled(state: UndefinedOr[bool]) -> Self

Set whether this command will be enabled in DMs with the bot.

PARAMETER DESCRIPTION
state

Whether this command is enabled in DMs with the bot.

TYPE: UndefinedOr[bool]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

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

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

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder to allow for chained calls.

set_name_localizations abstractmethod #

set_name_localizations(
    name_localizations: Mapping[Union[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[Union[Locale, str], str]

RETURNS DESCRIPTION
CommandBuilder

Object of this command builder.

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.

label abstractmethod property #

label: str

Label above this text input.

max_length abstractmethod property #

max_length: int

Maximum length the text should have.

min_length abstractmethod property #

min_length: int

Minimum length the text should have.

placeholder abstractmethod property #

placeholder: UndefinedOr[str]

Placeholder text for when the text input is empty.

style abstractmethod property #

Style to use for the text input.

type abstractmethod property #

Type of component this builder represents.

value abstractmethod property #

value: UndefinedOr[str]

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

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

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

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

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

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

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

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

set_style abstractmethod #

set_style(style: Union[TextInputStyle, int]) -> Self

Set the style to use for the text input.

PARAMETER DESCRIPTION
style

Style to use for the text input.

TYPE: Union[TextInputStyle, int]

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

RETURNS DESCRIPTION
TextInputBuilder

The builder object to enable chained calls.

TextSelectMenuBuilder #

Bases: SelectMenuBuilder, ABC, Generic[_ParentT]

Builder class for a text 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.

options abstractmethod property #

Sequence of the options set for this select menu.

parent abstractmethod property #

parent: _ParentT

Parent object which initialised this builder.

placeholder abstractmethod property #

placeholder: UndefinedOr[str]

Placeholder text to display when no options are selected.

type abstractmethod property #

Type of component this builder represents.

add_option abstractmethod #

add_option(
    label: str,
    value: str,
    /,
    *,
    description: UndefinedOr[str] = undefined.UNDEFINED,
    emoji: Union[Snowflakeish, Emoji, str, UndefinedType] = undefined.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: Union[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.

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

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

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

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

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

RETURNS DESCRIPTION
SelectMenuBuilder

The builder object to enable chained calls.

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.