Class: Discordrb::Reaction

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#burst_coloursArray<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_countInteger (readonly)



34
35
36
# File 'lib/discordrb/data/reaction.rb', line 34

def burst_count
  @burst_count
end

#countInteger (readonly)



13
14
15
# File 'lib/discordrb/data/reaction.rb', line 13

def count
  @count
end

#idInteger (readonly)



20
21
22
# File 'lib/discordrb/data/reaction.rb', line 20

def id
  @id
end

#metrue, false (readonly) Also known as: me?



16
17
18
# File 'lib/discordrb/data/reaction.rb', line 16

def me
  @me
end

#me_bursttrue, false (readonly) Also known as: me_burst?



26
27
28
# File 'lib/discordrb/data/reaction.rb', line 26

def me_burst
  @me_burst
end

#nameString (readonly)



23
24
25
# File 'lib/discordrb/data/reaction.rb', line 23

def name
  @name
end

#normal_countInteger (readonly)



37
38
39
# File 'lib/discordrb/data/reaction.rb', line 37

def normal_count
  @normal_count
end

Instance Method Details

#to_sString

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