hikari.impl.special_endpoints#

Special endpoint implementations.

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

Module Contents#

class hikari.impl.special_endpoints.ChannelSelectMenuBuilder[source]#

Bases: SelectMenuBuilder[_ContainerProtoT], hikari.api.special_endpoints.ChannelSelectMenuBuilder[_ContainerProtoT]

Builder class for channel select menus.

class hikari.impl.special_endpoints.CommandBuilder[source]#

Bases: hikari.api.special_endpoints.CommandBuilder

Standard implementation of hikari.api.special_endpoints.CommandBuilder.

class hikari.impl.special_endpoints.ContextMenuCommandBuilder[source]#

Bases: CommandBuilder, hikari.api.special_endpoints.ContextMenuCommandBuilder

Builder class for context menu commands.

class hikari.impl.special_endpoints.GuildBuilder[source]#

Bases: hikari.api.special_endpoints.GuildBuilder

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 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()
class hikari.impl.special_endpoints.InteractionAutocompleteBuilder[source]#

Bases: hikari.api.special_endpoints.InteractionAutocompleteBuilder

Standard implementation of hikari.api.special_endpoints.InteractionAutocompleteBuilder.

set_choices(choices, /)[source]#

Set autocomplete choices.

Returns:
InteractionAutocompleteBuilder

Object of this builder.

class hikari.impl.special_endpoints.InteractionDeferredBuilder[source]#

Bases: hikari.api.special_endpoints.InteractionDeferredBuilder

Standard implementation of hikari.api.special_endpoints.InteractionDeferredBuilder.

Parameters:
typehikari.interactions.base_interactions.DeferredResponseTypesT

The type of interaction response this is.

class hikari.impl.special_endpoints.InteractionMessageBuilder[source]#

Bases: hikari.api.special_endpoints.InteractionMessageBuilder

Standard implementation of hikari.api.special_endpoints.InteractionMessageBuilder.

Parameters:
typehikari.interactions.base_interactions.MessageResponseTypesT

The type of interaction response this is.

Other Parameters:
contenthikari.undefined.UndefinedOr[str]

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

class hikari.impl.special_endpoints.InteractionModalBuilder[source]#

Bases: hikari.api.special_endpoints.InteractionModalBuilder

Standard implementation of hikari.api.special_endpoints.InteractionModalBuilder.

class hikari.impl.special_endpoints.InteractiveButtonBuilder[source]#

Bases: _ButtonBuilder[_ContainerProtoT], hikari.api.special_endpoints.InteractiveButtonBuilder[_ContainerProtoT]

Builder class for interactive buttons.

class hikari.impl.special_endpoints.LinkButtonBuilder[source]#

Bases: _ButtonBuilder[_ContainerProtoT], hikari.api.special_endpoints.LinkButtonBuilder[_ContainerProtoT]

Builder class for link buttons.

class hikari.impl.special_endpoints.MessageActionRowBuilder[source]#

Bases: hikari.api.special_endpoints.MessageActionRowBuilder

Standard implementation of hikari.api.special_endpoints.ActionRowBuilder.

class hikari.impl.special_endpoints.ModalActionRowBuilder[source]#

Bases: hikari.api.special_endpoints.ModalActionRowBuilder

Standard implementation of hikari.api.special_endpoints.ActionRowBuilder.

class hikari.impl.special_endpoints.SelectMenuBuilder[source]#

Bases: hikari.api.special_endpoints.SelectMenuBuilder[_ContainerProtoT]

Builder class for select menus.

class hikari.impl.special_endpoints.SlashCommandBuilder[source]#

Bases: CommandBuilder, hikari.api.special_endpoints.SlashCommandBuilder

Builder class for slash commands.

class hikari.impl.special_endpoints.TextInputBuilder[source]#

Bases: hikari.api.special_endpoints.TextInputBuilder[_ContainerProtoT]

Standard implementation of hikari.api.special_endpoints.TextInputBuilder.

class hikari.impl.special_endpoints.TextSelectMenuBuilder[source]#

Bases: SelectMenuBuilder[_ContainerProtoT], hikari.api.special_endpoints.TextSelectMenuBuilder[_ContainerProtoT]

Builder class for text select menus.

class hikari.impl.special_endpoints.TypingIndicator(request_call, channel, rest_close_event)[source]#

Bases: hikari.api.special_endpoints.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.