Class: Discorb::Interaction
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- Discorb::Interaction
- Defined in:
- lib/discorb/interaction/root.rb,
lib/discorb/interaction/response.rb
Overview
Represents an interaction of Discord.
Direct Known Subclasses
AutoComplete, CommandInteraction, MessageComponentInteraction, ModalInteraction
Defined Under Namespace
Modules: ModalResponder, SourceResponder, UpdateResponder
Instance Attribute Summary collapse
-
#application_id -> Discorb::Snowflake
readonly
The ID of the application that created the interaction.
-
#guild_locale -> Symbol
readonly
The locale of the guild that created the interaction.
-
#id -> Discorb::Snowflake
readonly
The ID of the interaction.
-
#locale -> Symbol
readonly
The locale of the user that created the interaction.
-
#token -> String
readonly
The token for the interaction.
-
#type -> Symbol
readonly
The type of interaction.
-
#user -> Discorb::User, Discorb::Member
(also: #member)
readonly
The user or member that created the interaction.
-
#version -> Integer
readonly
The type of interaction.
Instance Method Summary collapse
Methods inherited from DiscordModel
Instance Attribute Details
#application_id -> Discorb::Snowflake (readonly)
Returns The ID of the application that created the interaction.
11 12 13 |
# File 'lib/discorb/interaction/root.rb', line 11 def application_id @application_id end |
#guild_locale -> Symbol (readonly)
This modifies the language code, -
will be replaced with _
.
Returns The locale of the guild that created the interaction.
27 28 29 |
# File 'lib/discorb/interaction/root.rb', line 27 def guild_locale @guild_locale end |
#id -> Discorb::Snowflake (readonly)
Returns The ID of the interaction.
9 10 11 |
# File 'lib/discorb/interaction/root.rb', line 9 def id @id end |
#locale -> Symbol (readonly)
This modifies the language code, -
will be replaced with _
.
Returns The locale of the user that created the interaction.
24 25 26 |
# File 'lib/discorb/interaction/root.rb', line 24 def locale @locale end |
#token -> String (readonly)
Returns The token for the interaction.
21 22 23 |
# File 'lib/discorb/interaction/root.rb', line 21 def token @token end |
#type -> Symbol (readonly)
Returns The type of interaction.
13 14 15 |
# File 'lib/discorb/interaction/root.rb', line 13 def type @type end |
#user -> Discorb::User, Discorb::Member (readonly) Also known as: member
Returns The user or member that created the interaction.
15 16 17 |
# File 'lib/discorb/interaction/root.rb', line 15 def user @user end |
#version -> Integer (readonly)
This is always 1
for now.
Returns The type of interaction.
19 20 21 |
# File 'lib/discorb/interaction/root.rb', line 19 def version @version end |
Instance Method Details
#channel -> Object
75 76 77 |
# File 'lib/discorb/interaction/root.rb', line 75 def channel @client.channels[@channel_id] end |
#guild -> Object
71 72 73 |
# File 'lib/discorb/interaction/root.rb', line 71 def guild @client.guilds[@guild_id] end |
#inspect -> Object
79 80 81 |
# File 'lib/discorb/interaction/root.rb', line 79 def inspect "#<#{self.class} id=#{@id}>" end |