# frozen_string_literal: true

require 'discordrb/events/generic'
require 'discordrb/data'

module Discordrb::Events
  # Generic superclass for events about adding and removing reactions
  class ReactionEvent
    # @return [Emoji] the emoji that was reacted with.
    attr_reader :emoji

    def initialize(data, bot)
      @bot = bot

      @emoji = Discordrb::Emoji.new(data['emoji'], bot, nil)
      @user_id = data['user_id'].to_i
      @message_id = data['message_id'].to_i
      @channel_id = data['channel_id'].to_i
    end
  end
end

# frozen_string_literal: true

require 'discordrb/events/generic'
require 'discordrb/data'

module Discordrb::Events
  # Generic superclass for events about adding and removing reactions
  class ReactionEvent
    def initialize(data, bot)
      @bot = bot

      @emoji = Discordrb::Emoji.new(data['emoji'], bot, nil)
      @user_id = data['user_id'].to_i
      @message_id = data['message_id'].to_i
      @channel_id = data['channel_id'].to_i
    end
  end
end

--- 
+++ 
@@ -6,6 +6,9 @@
 module Discordrb::Events
   # Generic superclass for events about adding and removing reactions
   class ReactionEvent
+    # @return [Emoji] the emoji that was reacted with.
+    attr_reader :emoji
+
     def initialize(data, bot)
       @bot = bot
 
Add a reader for a ReactionEvent's emoji
