Class: Discorb::Gateway::ReactionRemoveEmojiEvent

Inherits:
GatewayEvent
  • Object
show all
Defined in:
lib/discorb/gateway_events.rb

Overview

Represents a MESSAGE_REACTION_REMOVE_EMOJI event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from GatewayEvent

#inspect

Instance Attribute Details

#channelnil, Discorb::Channel (readonly)

Note:

This method returns an object from client cache. it will return nil if the object is not in cache.

Returns:

  • (nil)

    The object wasn't cached.

  • (Discorb::Channel)

    The channel the message was sent in.



224
225
226
# File 'lib/discorb/gateway_events.rb', line 224

def channel
  @channel
end

#channel_idDiscorb::Snowflake (readonly)

Returns The ID of the channel the message was sent in.

Returns:



217
218
219
# File 'lib/discorb/gateway_events.rb', line 217

def channel_id
  @channel_id
end

#emojiDiscorb::UnicodeEmoji, Discorb::PartialEmoji (readonly)

Returns The emoji that was reacted with.

Returns:



232
233
234
# File 'lib/discorb/gateway_events.rb', line 232

def emoji
  @emoji
end

#guildnil, Discorb::Guild (readonly)

Note:

This method returns an object from client cache. it will return nil if the object is not in cache.

Returns:

  • (nil)

    The object wasn't cached.

  • (Discorb::Guild)

    The guild the message was sent in.



227
228
229
# File 'lib/discorb/gateway_events.rb', line 227

def guild
  @guild
end

#guild_idDiscorb::Snowflake (readonly)

Returns The ID of the guild the message was sent in.

Returns:



221
222
223
# File 'lib/discorb/gateway_events.rb', line 221

def guild_id
  @guild_id
end

#messagenil, Discorb::Message (readonly)

Note:

This method returns an object from client cache. it will return nil if the object is not in cache.

Returns:

  • (nil)

    The object wasn't cached.

  • (Discorb::Message)

    The message the reaction was sent in.



230
231
232
# File 'lib/discorb/gateway_events.rb', line 230

def message
  @message
end

#message_idDiscorb::Snowflake (readonly)

Returns The ID of the message.

Returns:



219
220
221
# File 'lib/discorb/gateway_events.rb', line 219

def message_id
  @message_id
end

Instance Method Details

#fetch_message(force: false) ⇒ Async::Task<Discorb::Message>

Fetch the message. If message is cached, it will be returned.

Parameters:

  • force (Boolean) (defaults to: false)

    Whether to force fetching the message.

Returns:



267
268
269
270
271
272
273
# File 'lib/discorb/gateway_events.rb', line 267

def fetch_message(force: false)
  Async do
    next @message if !force && @message

    @message = @channel.fetch_message(@message_id).wait
  end
end