class Discorb::Reaction
Represents a reaction to a message.
Attributes
count[R]
@return [Integer] The number of users that have reacted with this emoji.
emoji[R]
@return [Discorb::Emoji] The emoji that was reacted with.
me[R]
@return [Boolean] Whether client user reacted with this emoji.
me?[R]
@return [Boolean] Whether client user reacted with this emoji.
message[R]
@return [Discorb::Message] The message that this reaction is on.
reacted?[R]
@return [Boolean] Whether client user reacted with this emoji.
Public Class Methods
new(message, data)
click to toggle source
@!visibility private
# File lib/discorb/reaction.rb, line 20 def initialize(message, data) @message = message _set_data(data) end
Public Instance Methods
fetch_users(...)
click to toggle source
Fetch the user that reacted with this emoji.
@param (see Message#fetch_reacted_users
)
@return [Array<Discorb::User>] The users that reacted with this emoji.
# File lib/discorb/reaction.rb, line 32 def fetch_users(...) message.fetch_reacted_users(@emoji, ...) end
Private Instance Methods
_set_data(data)
click to toggle source
# File lib/discorb/reaction.rb, line 38 def _set_data(data) @count = data[:count] @me = data[:me] @emoji = if data[:emoji][:id].nil? UnicodeEmoji.new(data[:emoji][:name]) else PartialEmoji.new(data[:emoji]) end end