ILLEST Developers

illest.py 2.3.1

Interactions

Read from the library itself: every signature and every word here is its own docstring.

Interaction

class

illest.Interaction

class Interaction(message_id: 'Any' = None, channel_id: 'Any' = None, custom_id: 'str | None' = None, sender_id: 'int' = 0, sender_verified: 'bool' = False, _client: "'Client | None'" = None, *, type: 'InteractionType' = <InteractionType.component: 3>, data: 'dict[str, Any] | None' = None, id: 'Any' = None, sent_at: 'float | None' = None, thread_root: 'str | None' = None)

One use of something the bot offered.

data is the interaction's own data: for a command {name, type, options, target_id}, for a component {custom_id, component_type, values}, for a form {custom_id, components: [{customId, value}]}.

message_id

property

channel_id_wire

property

custom_id

property

sender_id

property

sender_verified

property

respond

async
async respond(text: 'str | None' = None, *, ephemeral: 'bool' = False, **kwargs: 'Any') -> "'Message'"

The first version's answer: a message, ephemeral when asked. response.send_message is the current way.

id

property

client

property

application_id

property

created_at

property

expires_at

property

is_expired

is_expired() -> 'bool'

channel_id

property

channel

property

guild

property

guild_id

property

user

property

A Member in a server the bot knows, else a User.

author

property

A Member in a server the bot knows, else a User.

message

property

The bot's message whose button or menu was used.

permissions

property

app_permissions

property

namespace

property

is_guild_integration

is_guild_integration() -> 'bool'

is_user_integration

is_user_integration() -> 'bool'

context

property

original_response

async
async original_response() -> "'Message'"

edit_original_response

async
async edit_original_response(*, content: 'Any' = Ellipsis, embed: 'Any' = Ellipsis, embeds: 'Any' = Ellipsis, attachments: 'Any' = Ellipsis, view: 'Any' = Ellipsis, allowed_mentions: 'Any' = None) -> "'Message'"

delete_original_response

async
async delete_original_response() -> 'None'

translate

async
async translate(string: 'Any', **_: 'Any') -> 'str'

InteractionResponse

class

illest.interactions.InteractionResponse

class InteractionResponse(parent: 'Interaction')

The first answer to an interaction: a message, a thinking state, an edit of the message used, a form, or suggestions.

type

property

is_done

is_done() -> 'bool'

send_message

async
async send_message(content: 'Any' = None, *, embed: 'Any' = None, embeds: 'Sequence[Any] | None' = None, file: 'Any' = None, files: 'Sequence[Any] | None' = None, view: "'View | None'" = None, tts: 'bool' = False, ephemeral: 'bool' = False, allowed_mentions: 'Any' = None, suppress_embeds: 'bool' = False, silent: 'bool' = False, delete_after: 'float | None' = None, poll: 'Any' = None) -> 'InteractionCallbackResponse'

defer

async
async defer(*, ephemeral: 'bool' = False, thinking: 'bool' = False) -> 'InteractionCallbackResponse | None'

Say the bot is working on it. A command always shows "<bot> is thinking…" until the answer replaces it; a button or menu shows it only with thinking=True, and otherwise just takes the press.

send_toast

async
async send_toast(text: 'str', *, alert: 'bool' = False) -> 'InteractionCallbackResponse'

Answer with a short notice only the person who used this sees, up to 200 characters: it shows for a few seconds and is not kept in the conversation. alert=True shows it as a box they close instead. An app too old to show notices shows it as a reply only they can see.

edit_message

async
async edit_message(*, content: 'Any' = Ellipsis, embed: 'Any' = Ellipsis, embeds: 'Any' = Ellipsis, attachments: 'Any' = Ellipsis, view: 'Any' = Ellipsis, allowed_mentions: 'Any' = None, delete_after: 'float | None' = None, suppress_embeds: 'bool' = False) -> 'InteractionCallbackResponse'

Change the bot's message whose button or menu was used (a button's or menu's interaction only).

send_modal

async
async send_modal(modal: "'Modal'", /) -> 'InteractionCallbackResponse'

Show a form to the person who used this. Not in answer to a form.

autocomplete

async
async autocomplete(choices: 'Sequence[Any]') -> 'None'

Suggestions for the option being typed, in answer to an autocomplete interaction.

pong

async
async pong() -> 'None'

launch_activity

async
async launch_activity() -> 'None'

require_premium

async
async require_premium() -> 'None'

Webhook

class

illest.interactions.Webhook

class Webhook(parent: 'Interaction')

interaction.followup: more messages after the first answer. The first follow-up after defer() fills the thinking message.

send

async
async send(content: 'Any' = None, *, embed: 'Any' = None, embeds: 'Sequence[Any] | None' = None, file: 'Any' = None, files: 'Sequence[Any] | None' = None, view: "'View | None'" = None, ephemeral: 'bool' = False, allowed_mentions: 'Any' = None, silent: 'bool' = False, wait: 'bool' = True, username: 'str | None' = None, avatar_url: 'str | None' = None, tts: 'bool' = False, suppress_embeds: 'bool' = False, delete_after: 'float | None' = None, poll: 'Any' = None, **_: 'Any') -> "'Message'"

edit_message

async
async edit_message(message_id: 'Any', **kwargs: 'Any') -> "'Message'"

delete_message

async
async delete_message(message_id: 'Any', /) -> 'None'

fetch_message

async
async fetch_message(message_id: 'Any', /) -> "'Message'"