Class: Discordrb::Reaction
- Inherits:
-
Object
- Object
- Discordrb::Reaction
- Defined in:
- lib/discordrb/data/reaction.rb
Overview
A reaction to a message.
Constant Summary collapse
- TYPES =
Map of reaction types.
{ normal: 0, burst: 1 }.freeze
Instance Attribute Summary collapse
-
#burst_colours ⇒ Array<ColourRGB>
(also: #burst_colors)
readonly
An array of colors used for animations in burst reactions.
-
#burst_count ⇒ Integer
readonly
The total amount of users who have reacted with this reaction as a burst reaction.
-
#count ⇒ Integer
readonly
The total amount of users who have reacted with this reaction (including burst reactions).
-
#id ⇒ Integer
readonly
The ID of the emoji, if it was custom.
-
#me ⇒ true, false
(also: #me?)
readonly
Whether the current bot or user used this reaction.
-
#me_burst ⇒ true, false
(also: #me_burst?)
readonly
Whether the current bot or user used this reaction as a burst reaction.
-
#name ⇒ String
readonly
The name or unicode representation of the emoji.
-
#normal_count ⇒ Integer
readonly
The total amount of users who have reacted with this reaction as a normal reaction.
Instance Method Summary collapse
-
#to_s ⇒ String
Converts this Reaction into a string that can be sent back to Discord in other reaction endpoints.
Instance Attribute Details
#burst_colours ⇒ Array<ColourRGB> (readonly) Also known as: burst_colors
30 31 32 |
# File 'lib/discordrb/data/reaction.rb', line 30 def burst_colours @burst_colours end |
#burst_count ⇒ Integer (readonly)
34 35 36 |
# File 'lib/discordrb/data/reaction.rb', line 34 def burst_count @burst_count end |
#count ⇒ Integer (readonly)
13 14 15 |
# File 'lib/discordrb/data/reaction.rb', line 13 def count @count end |
#id ⇒ Integer (readonly)
20 21 22 |
# File 'lib/discordrb/data/reaction.rb', line 20 def id @id end |
#me ⇒ true, false (readonly) Also known as: me?
16 17 18 |
# File 'lib/discordrb/data/reaction.rb', line 16 def me @me end |
#me_burst ⇒ true, false (readonly) Also known as: me_burst?
26 27 28 |
# File 'lib/discordrb/data/reaction.rb', line 26 def me_burst @me_burst end |
#name ⇒ String (readonly)
23 24 25 |
# File 'lib/discordrb/data/reaction.rb', line 23 def name @name end |
#normal_count ⇒ Integer (readonly)
37 38 39 |
# File 'lib/discordrb/data/reaction.rb', line 37 def normal_count @normal_count end |
Instance Method Details
#to_s ⇒ String
Converts this Reaction into a string that can be sent back to Discord in other reaction endpoints.
If ID is present, it will be rendered into the form of name:id.
54 55 56 |
# File 'lib/discordrb/data/reaction.rb', line 54 def to_s id.nil? ? name : "#{name}:#{id}" end |