lightbulb.components.base¶
- class BaseComponent[source]¶
Abstract base class for a component that can be added to an action row builder.
- class BuildableComponentContainer[source]¶
Abstract base class allowing subclasses to be used as containers for
BaseComponent`s, as well as being passed to the ``components=`
kwarg of respond methods.This class does not require
super().__init__()
to be called within subclasses.
- class MessageResponseMixinWithEdit[source]¶
Abstract mixin derived from
MessageResponseMixin
that additionally allows creating an initial response of typehikari.interactions.base_interactions.ResponseType.MESSAGE_UPDATE
(and the deferred variant).- async defer(*, ephemeral: bool = False, edit: bool = False) None [source]¶
Defer the creation of a response for the interaction that this context represents.
- Parameters:
ephemeral – Whether to defer ephemerally (message only visible to the user that triggered the command).
edit – Whether the eventual response should cause an edit instead of creating a new message.
- Returns:
- async respond(content: hikari.UndefinedOr[t.Any] = UNDEFINED, *, ephemeral: bool = False, edit: bool = False, flags: int | MessageFlag | UndefinedType = UNDEFINED, tts: hikari.UndefinedOr[bool] = UNDEFINED, attachment: hikari.UndefinedOr[hikari.Resourceish] = UNDEFINED, attachments: hikari.UndefinedOr[Sequence[hikari.Resourceish]] = UNDEFINED, component: hikari.UndefinedOr[special_endpoints.ComponentBuilder] = UNDEFINED, components: hikari.UndefinedOr[Sequence[special_endpoints.ComponentBuilder]] = UNDEFINED, embed: hikari.UndefinedOr[Embed] = UNDEFINED, embeds: hikari.UndefinedOr[Sequence[Embed]] = UNDEFINED, poll: hikari.UndefinedOr[special_endpoints.PollBuilder] = UNDEFINED, mentions_everyone: hikari.UndefinedOr[bool] = UNDEFINED, user_mentions: hikari.UndefinedOr[hikari.SnowflakeishSequence[PartialUser] | bool] = UNDEFINED, role_mentions: hikari.UndefinedOr[hikari.SnowflakeishSequence[PartialRole] | bool] = UNDEFINED) hikari.Snowflakeish [source]¶
Create a response to the interaction that this context represents.
- Parameters:
content – The message contents.
ephemeral – Whether the message should be ephemeral (only visible to the user that triggered the command). This is just a convenience argument - passing
flags=hikari.MessageFlag.EPHEMERAL
will function the same way.edit – Whether the response should cause an edit instead of creating a new message.
attachment – The message attachment.
attachments – The message attachments.
component – The builder object of the component to include in this message.
components – The sequence of the component builder objects to include in this message.
embed – The message embed.
embeds – The message embeds.
poll – The poll to include with the message. Ignored when
edit=True
.flags – The message flags this response should have.
tts – Whether the message will be read out by a screen reader using Discord’s TTS (text-to-speech) system.
mentions_everyone – Whether the message should parse @everyone/@here mentions.
user_mentions – The user mentions to include in the message.
role_mentions – The role mentions to include in the message.
- Returns:
- An identifier for the response. This can then be used to edit,
delete, or fetch the response message using the appropriate methods.
- Return type:
Note
This documentation does not contain a full description of the parameters as they would just be copy-pasted from the hikari documentation. See
create_initial_response()
for a more detailed description.Note
If this is not creating an initial response and
edit
isTrue
, then this will always edit the initial response, not the most recently created response.