class Discorb::Gateway::ReactionRemoveEmojiEvent
Represents a `MESSAGE_REACTION_REMOVE_EMOJI` event.
Attributes
@macro client_cache @return [Discorb::Channel] The channel the message was sent in.
@return [Discorb::Snowflake] The ID of the channel the message was sent in.
@return [Discorb::UnicodeEmoji, Discorb::PartialEmoji] The emoji that was reacted with.
@macro client_cache @return [Discorb::Guild] The guild the message was sent in.
@return [Discorb::Snowflake] The ID of the guild the message was sent in.
@macro client_cache @return [Discorb::Message] The message the reaction was sent in.
@return [Discorb::Snowflake] The ID of the message.
Public Class Methods
@!visibility private
# File lib/discorb/gateway.rb, line 175 def initialize(client, data) @client = client @data = data @guild_id = Snowflake.new(data[:guild_id]) @channel_id = Snowflake.new(data[:channel_id]) @message_id = Snowflake.new(data[:message_id]) @guild = client.guilds[data[:guild_id]] @channel = client.channels[data[:channel_id]] @message = client.messages[data[:message_id]] @emoji = data[:emoji][:id].nil? ? DiscordEmoji.new(data[:emoji][:name]) : PartialEmoji.new(data[:emoji]) end
Public Instance Methods
Fetch the message. If message is cached, it will be returned. @macro async @macro http
@param [Boolean] force Whether to force fetching the message.
@return [Discorb::Message] The message.
# File lib/discorb/gateway.rb, line 195 def fetch_message(force: false) Async do next @message if !force && @message @message = @channel.fetch_message(@message_id).wait end end