Class: Discordrb::Events::ReactionEvent

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

Overview

Generic superclass for events about adding and removing reactions

Direct Known Subclasses

ReactionAddEvent, ReactionRemoveEvent

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Methods included from Respondable

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

Instance Attribute Details

#bursttrue, false (readonly) Also known as: burst?



18
19
20
# File 'lib/discordrb/events/reactions.rb', line 18

def burst
  @burst
end

#burst_coloursArray<ColourRGB> (readonly) Also known as: burst_colors



25
26
27
# File 'lib/discordrb/events/reactions.rb', line 25

def burst_colours
  @burst_colours
end

#emojiEmoji (readonly)



12
13
14
# File 'lib/discordrb/events/reactions.rb', line 12

def emoji
  @emoji
end

#typeInteger (readonly)



22
23
24
# File 'lib/discordrb/events/reactions.rb', line 22

def type
  @type
end

Instance Method Details

#channelChannel



57
58
59
# File 'lib/discordrb/events/reactions.rb', line 57

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

#messageMessage



52
53
54
# File 'lib/discordrb/events/reactions.rb', line 52

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

#serverServer?



62
63
64
# File 'lib/discordrb/events/reactions.rb', line 62

def server
  @server ||= channel.server
end

#userUser, Member



42
43
44
45
46
47
48
49
# File 'lib/discordrb/events/reactions.rb', line 42

def user
  # Cache the user so we don't do requests all the time
  @user ||= if server
              @server.member(@user_id)
            else
              @bot.user(@user_id)
            end
end