Method: Discordrb::Reaction#initialize
- Defined in:
- lib/discordrb/data/reaction.rb
#initialize(data) ⇒ Reaction (private)
Returns a new instance of Reaction.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/discordrb/data/reaction.rb', line 40 def initialize(data) @count = data['count'] @me = data['me'] @id = data['emoji']['id']&.to_i @name = data['emoji']['name'] @me_burst = data['me_burst'] @burst_colours = data['burst_colors'].map { |b| ColourRGB.new(b.delete('#')) } @burst_count = data['count_details']['burst'] @normal_count = data['count_details']['normal'] end |