Class: RubyCord::Client::Gateway::Event::ReactionRemoveAllEvent

Inherits:
RubyCord::Client::Gateway::Event show all
Defined in:
lib/rubycord/client/gateway/event.rb

Overview

Represents a MESSAGE_REACTION_REMOVE_ALL event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RubyCord::Client::Gateway::Event

#inspect

Instance Attribute Details

#channelnil, RubyCord::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.

  • (RubyCord::Channel)

    The channel the message was sent in.



170
171
172
# File 'lib/rubycord/client/gateway/event.rb', line 170

def channel
  @channel
end

#channel_idRubyCord::Snowflake (readonly)

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

Returns:



163
164
165
# File 'lib/rubycord/client/gateway/event.rb', line 163

def channel_id
  @channel_id
end

#guildnil, RubyCord::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.

  • (RubyCord::Guild)

    The guild the message was sent in.



173
174
175
# File 'lib/rubycord/client/gateway/event.rb', line 173

def guild
  @guild
end

#guild_idRubyCord::Snowflake (readonly)

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

Returns:



167
168
169
# File 'lib/rubycord/client/gateway/event.rb', line 167

def guild_id
  @guild_id
end

#messagenil, RubyCord::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.

  • (RubyCord::Message)

    The message the reaction was sent in.



176
177
178
# File 'lib/rubycord/client/gateway/event.rb', line 176

def message
  @message
end

#message_idRubyCord::Snowflake (readonly)

Returns The ID of the message.

Returns:



165
166
167
# File 'lib/rubycord/client/gateway/event.rb', line 165

def message_id
  @message_id
end

Instance Method Details

#fetch_message(force: false) ⇒ Async::Task<RubyCord::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:



203
204
205
206
207
208
209
# File 'lib/rubycord/client/gateway/event.rb', line 203

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

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