Class: Discordrb::Events::ReactionRemoveAllEvent

Inherits:
Event
  • Object
show all
Includes:
Respondable
Defined in:
lib/discordrb/events/reactions.rb

Overview

Event raised when somebody removes all reactions from a message

Instance Attribute Summary

Attributes inherited from Event

#bot

Instance Method Summary collapse

Methods included from Respondable

#<<, #drain, #drain_into, #send_embed, #send_message, #send_temporary_message

Constructor Details

#initialize(data, bot) ⇒ ReactionRemoveAllEvent

Returns a new instance of ReactionRemoveAllEvent.


115
116
117
118
119
120
# File 'lib/discordrb/events/reactions.rb', line 115

def initialize(data, bot)
  @bot = bot

  @message_id = data['message_id'].to_i
  @channel_id = data['channel_id'].to_i
end

Instance Method Details

#channelChannel

Returns the channel where the removal occurred.

Returns:

  • (Channel)

    the channel where the removal occurred.


123
124
125
# File 'lib/discordrb/events/reactions.rb', line 123

def channel
  @channel ||= @bot.channel(@channel_id)
end

#messageMessage

Returns the message all reactions were removed from.

Returns:

  • (Message)

    the message all reactions were removed from.


128
129
130
# File 'lib/discordrb/events/reactions.rb', line 128

def message
  @message ||= channel.load_message(@message_id)
end