Class: ReactionEvent
Instance Attribute Summary
Attributes inherited from Event
Instance Method Summary collapse
-
#added? ⇒ Boolean
Is this a reaction add event?.
-
#channel ⇒ Object
The channel ID of the message the reaction was on.
-
#message ⇒ Message
The message that was reacted on.
-
#message_from_self? ⇒ Boolean
Is the reaction on a message that was posted by the bot?.
-
#reaction ⇒ String
The name of the reaction that was reacted with.
-
#reaction? ⇒ true
Is this a reaction event?.
-
#reaction_on_message? ⇒ Boolean
Is this a reaction on a message?.
-
#removed? ⇒ Boolean
Is this a reaction remove event?.
-
#user ⇒ User
Get the user that reacted on the message.
Methods inherited from Event
Instance Method Details
#added? ⇒ Boolean
Is this a reaction add event?
48 49 50 |
# File 'src/events/reaction_event.rb', line 48 def added? data.type == 'reaction_added' end |
#channel ⇒ Object
The channel ID of the message the reaction was on
62 63 64 |
# File 'src/events/reaction_event.rb', line 62 def channel data.item.channel end |
#message ⇒ Message
TODO:
Test
TODO:
Support reactions on files
The message that was reacted on
72 73 74 75 76 77 78 79 |
# File 'src/events/reaction_event.rb', line 72 def @_message ||= Message.from_partial( @app, data.item.type, data.item.channel, data.item.ts ) end |
#message_from_self? ⇒ Boolean
Is the reaction on a message that was posted by the bot?
84 85 86 |
# File 'src/events/reaction_event.rb', line 84 def == app.user_id end |
#reaction ⇒ String
The name of the reaction that was reacted with
Does not include :
.
41 42 43 |
# File 'src/events/reaction_event.rb', line 41 def reaction data.reaction end |
#reaction? ⇒ true
Is this a reaction event?
16 17 18 |
# File 'src/events/reaction_event.rb', line 16 def reaction? true end |
#reaction_on_message? ⇒ Boolean
Is this a reaction on a message?
Other reaction types may be on files.
25 26 27 |
# File 'src/events/reaction_event.rb', line 25 def @data.item.type == 'message' end |
#removed? ⇒ Boolean
Is this a reaction remove event?
55 56 57 |
# File 'src/events/reaction_event.rb', line 55 def removed? !added? end |