DiscordInteraction¶
Inherits: DiscordEntity < Reference < Object
Inherited By: DiscordAutocompleteInteraction, DiscordRepliableInteraction
Description¶
Abstraction of Discord interactions such as Application Commands and Message Components. An interaction remains valid for 15 minutes.
Properties¶
Methods¶
return type | signature |
---|---|
DiscordApplication | get_application ( ) |
Guild | get_guild ( ) |
TextChannel | get_channel ( ) |
Guild.Member | get_member ( ) |
int | get_user_id ( ) |
User | get_user ( ) |
bool | is_command ( ) |
bool | is_autocomplete ( ) |
bool | is_message_component ( ) |
bool | is_modal_submit ( ) |
bool | in_guild ( ) |
User | fetch_user ( ) coroutine |
TextChannel | fetch_channel ( ) coroutine |
Guild.Member | fetch_member ( ) coroutine |
Guild | fetch_guild ( ) coroutine |
Constants¶
-
Dictionary Type
-
PING = 1
-
APPLICATION_COMMAND = 2
-
MESSAGE_COMPONENT = 3
-
AUTOCOMPLETE = 4
-
MODAL_SUBMIT = 5
Interaction types.
-
-
Dictionary Callback
-
PONG = 1
-
CHANNEL_MESSAGE = 4
-
DEFERRED_CHANNEL_MESSAGE = 5
-
DEFERRED_UPDATE_MESSAGE = 6
-
UPDATE_MESSAGE = 7
-
AUTOCOMPLETE_RESULT = 8
-
MODAL = 9
Interaction callback types.
-
Property Descriptions¶
-
int application_id
Id of the Discord application this interaction is for.
-
DiscordApplication application
method Getter get_application() Reference to the Discord application.
-
int type
Type of interaction.
-
int guild_id
The guild id that the interaction was sent from.
-
Guild guild
method Getter get_guild() Reference to the guild that the interaction was sent from.
-
int channel_id
The channel id that the interaction was sent from.
-
TextChannel channel
method Getter get_channel() Reference to the channel that the interaction was sent from.
-
Guild.Member member
Guild member who invoked the interaction if inside a guild.
-
int user_id
method Getter get_user_id() User id of who invoked the interaction.
-
User user
method Getter get_user() Reference to the user who invoked the interaction.
-
String token
Continuation token for responding to the interaction.
-
int version
Discord Interaction API version.
-
BitFlag app_permissions
Set of permissions the app or bot has within the channel the interaction was sent from.
-
String locale
Selected language of the invoking user.
-
String guild_locale
Guild's preferred locale, if invoked in a guild.
Method Descriptions¶
-
DiscordApplication get_application ( )
application
getter.
-
Guild get_guild ( )
guild
getter.
-
TextChannel get_channel ( )
channel
getter.
-
Guild.Member get_member ( )
member
getter.
-
int get_user_id ( )
user_id
getter.
-
User get_user ( )
user
getter.
-
bool is_command ( )
Whether this is a
DiscordApplicationCommandInteraction
.
-
bool is_autocomplete ( )
Whether this is a
DiscordAutocompleteInteraction
.
-
bool is_message_component ( )
Whether this is a
DiscordMessageComponentInteraction
.
-
bool is_modal_submit ( )
Whether this is a
DiscordModalSubmit
.
-
bool in_guild ( )
Whether the interaction was invoked in a guild.
-
User fetch_user ( ) coroutine
Fetches the
user
.
-
TextChannel fetch_channel ( ) coroutine
Fetches the
channel
.
-
Guild.Member fetch_member ( ) coroutine
Fetches the
member
if the interaction was invoked in a guild.
-
Guild fetch_guild ( ) coroutine
Fetches the
guild
if the interaction was invoked in a guild.