Class: Discorb::Gateway::ReactionEvent
- Inherits:
-
GatewayEvent
- Object
- GatewayEvent
- Discorb::Gateway::ReactionEvent
- Defined in:
- lib/discorb/gateway.rb
Overview
Represents a reaction event.
Instance Attribute Summary collapse
- #channel -> nil, Discorb::Channel readonly
-
#channel_id -> Discorb::Snowflake
readonly
The ID of the channel the message was sent in.
-
#data -> Hash
readonly
The raw data of the event.
-
#emoji -> Discorb::UnicodeEmoji, Discorb::PartialEmoji
readonly
The emoji that was reacted with.
- #fired_by -> nil, ... (also: #reactor, #from) readonly
- #guild -> nil, Discorb::Guild readonly
-
#guild_id -> Discorb::Snowflake
readonly
The ID of the guild the message was sent in.
- #member -> nil, Discorb::Member readonly
- #message -> nil, Discorb::Message readonly
-
#message_id -> Discorb::Snowflake
readonly
The ID of the message.
- #user -> nil, Discorb::User readonly
-
#user_id -> Discorb::Snowflake
(also: #member_id)
readonly
The ID of the user who reacted.
Instance Method Summary collapse
-
#fetch_message(force: false) -> Async::Task<Discorb::Message>
Fetch the message.
Instance Attribute Details
#channel -> nil, Discorb::Channel (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
45 46 47 |
# File 'lib/discorb/gateway.rb', line 45 def channel @channel end |
#channel_id -> Discorb::Snowflake (readonly)
Returns The ID of the channel the message was sent in.
35 36 37 |
# File 'lib/discorb/gateway.rb', line 35 def channel_id @channel_id end |
#data -> Hash (readonly)
Returns The raw data of the event.
30 31 32 |
# File 'lib/discorb/gateway.rb', line 30 def data @data end |
#emoji -> Discorb::UnicodeEmoji, Discorb::PartialEmoji (readonly)
Returns The emoji that was reacted with.
56 57 58 |
# File 'lib/discorb/gateway.rb', line 56 def emoji @emoji end |
#fired_by -> nil, ... (readonly) Also known as: reactor, from
This method returns an object from client cache. it will return nil
if the object is not in cache.
59 60 61 |
# File 'lib/discorb/gateway.rb', line 59 def fired_by @fired_by end |
#guild -> nil, Discorb::Guild (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
48 49 50 |
# File 'lib/discorb/gateway.rb', line 48 def guild @guild end |
#guild_id -> Discorb::Snowflake (readonly)
Returns The ID of the guild the message was sent in.
39 40 41 |
# File 'lib/discorb/gateway.rb', line 39 def guild_id @guild_id end |
#member -> nil, Discorb::Member (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
54 55 56 |
# File 'lib/discorb/gateway.rb', line 54 def member @member end |
#message -> nil, Discorb::Message (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
51 52 53 |
# File 'lib/discorb/gateway.rb', line 51 def @message end |
#message_id -> Discorb::Snowflake (readonly)
Returns The ID of the message.
37 38 39 |
# File 'lib/discorb/gateway.rb', line 37 def @message_id end |
#user -> nil, Discorb::User (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
42 43 44 |
# File 'lib/discorb/gateway.rb', line 42 def user @user end |
#user_id -> Discorb::Snowflake (readonly) Also known as: member_id
Returns The ID of the user who reacted.
32 33 34 |
# File 'lib/discorb/gateway.rb', line 32 def user_id @user_id end |
Instance Method Details
#fetch_message(force: false) -> Async::Task<Discorb::Message>
Fetch the message. If message is cached, it will be returned.
102 103 104 105 106 107 108 |
# File 'lib/discorb/gateway.rb', line 102 def (force: false) Async do next @message if !force && @message @message = @channel.(@message_id).wait end end |