illest.py 2.3.1
Interactions
Read from the library itself: every signature and every word here is its own docstring.
Interaction
classillest.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
propertychannel_id_wire
propertycustom_id
propertysender_id
propertysender_verified
propertyrespond
asyncasync 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
propertyclient
propertyapplication_id
propertycreated_at
propertyexpires_at
propertyis_expired
is_expired() -> 'bool'
channel_id
propertychannel
propertyguild
propertyguild_id
propertyuser
propertyA Member in a server the bot knows, else a User.
message
propertyThe bot's message whose button or menu was used.
permissions
propertyapp_permissions
propertynamespace
propertyis_guild_integration
is_guild_integration() -> 'bool'
is_user_integration
is_user_integration() -> 'bool'
context
propertyoriginal_response
asyncasync original_response() -> "'Message'"
edit_original_response
asyncasync 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
asyncasync delete_original_response() -> 'None'
translate
asyncasync translate(string: 'Any', **_: 'Any') -> 'str'
InteractionResponse
classillest.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
propertyis_done
is_done() -> 'bool'
send_message
asyncasync 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
asyncasync 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
asyncasync 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
asyncasync 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
asyncasync send_modal(modal: "'Modal'", /) -> 'InteractionCallbackResponse'
Show a form to the person who used this. Not in answer to a form.
autocomplete
asyncasync autocomplete(choices: 'Sequence[Any]') -> 'None'
Suggestions for the option being typed, in answer to an autocomplete interaction.
pong
asyncasync pong() -> 'None'
launch_activity
asyncasync launch_activity() -> 'None'
Webhook
classillest.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
asyncasync 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
asyncasync edit_message(message_id: 'Any', **kwargs: 'Any') -> "'Message'"
delete_message
asyncasync delete_message(message_id: 'Any', /) -> 'None'
fetch_message
asyncasync fetch_message(message_id: 'Any', /) -> "'Message'"