Class: RubyCord::Client::Gateway::Event::ReactionEvent
- Inherits:
-
RubyCord::Client::Gateway::Event
- Object
- RubyCord::Client::Gateway::Event
- RubyCord::Client::Gateway::Event::ReactionEvent
- Defined in:
- lib/rubycord/client/gateway/event.rb
Overview
Represents a reaction event.
Instance Attribute Summary collapse
- #channel ⇒ nil, RubyCord::Channel readonly
-
#channel_id ⇒ RubyCord::Snowflake
readonly
The ID of the channel the message was sent in.
-
#data ⇒ Hash
readonly
The raw data of the event.
-
#emoji ⇒ RubyCord::UnicodeEmoji, RubyCord::PartialEmoji
readonly
The emoji that was reacted with.
- #guild ⇒ nil, RubyCord::Guild readonly
-
#guild_id ⇒ RubyCord::Snowflake
readonly
The ID of the guild the message was sent in.
- #message ⇒ nil, RubyCord::Message readonly
-
#message_id ⇒ RubyCord::Snowflake
readonly
The ID of the message.
- #user ⇒ nil, ... (also: #member) readonly
-
#user_id ⇒ RubyCord::Snowflake
(also: #member_id)
readonly
The ID of the user who reacted.
Instance Method Summary collapse
-
#fetch_message(force: false) ⇒ Async::Task<RubyCord::Message>
Fetch the message.
Methods inherited from RubyCord::Client::Gateway::Event
Instance Attribute Details
#channel ⇒ nil, RubyCord::Channel (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
46 47 48 |
# File 'lib/rubycord/client/gateway/event.rb', line 46 def channel @channel end |
#channel_id ⇒ RubyCord::Snowflake (readonly)
Returns The ID of the channel the message was sent in.
35 36 37 |
# File 'lib/rubycord/client/gateway/event.rb', line 35 def channel_id @channel_id end |
#data ⇒ Hash (readonly)
Returns The raw data of the event.
30 31 32 |
# File 'lib/rubycord/client/gateway/event.rb', line 30 def data @data end |
#emoji ⇒ RubyCord::UnicodeEmoji, RubyCord::PartialEmoji (readonly)
Returns The emoji that was reacted with.
54 55 56 |
# File 'lib/rubycord/client/gateway/event.rb', line 54 def emoji @emoji end |
#guild ⇒ nil, RubyCord::Guild (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
49 50 51 |
# File 'lib/rubycord/client/gateway/event.rb', line 49 def guild @guild end |
#guild_id ⇒ RubyCord::Snowflake (readonly)
Returns The ID of the guild the message was sent in.
39 40 41 |
# File 'lib/rubycord/client/gateway/event.rb', line 39 def guild_id @guild_id end |
#message ⇒ nil, RubyCord::Message (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
52 53 54 |
# File 'lib/rubycord/client/gateway/event.rb', line 52 def end |
#message_id ⇒ RubyCord::Snowflake (readonly)
Returns The ID of the message.
37 38 39 |
# File 'lib/rubycord/client/gateway/event.rb', line 37 def end |
#user ⇒ nil, ... (readonly) Also known as: member
This method returns an object from client cache. it will return nil
if the object is not in cache.
42 43 44 |
# File 'lib/rubycord/client/gateway/event.rb', line 42 def user @user end |
#user_id ⇒ RubyCord::Snowflake (readonly) Also known as: member_id
Returns The ID of the user who reacted.
32 33 34 |
# File 'lib/rubycord/client/gateway/event.rb', line 32 def user_id @user_id end |
Instance Method Details
#fetch_message(force: false) ⇒ Async::Task<RubyCord::Message>
Fetch the message. If message is cached, it will be returned.
112 113 114 115 116 117 118 |
# File 'lib/rubycord/client/gateway/event.rb', line 112 def (force: false) Async do next if !force && = @channel.().wait end end |