Class: RubyCord::Reaction

Inherits:
DiscordModel show all
Defined in:
lib/rubycord/reaction.rb

Overview

Represents a reaction to a message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?, #inspect

Instance Attribute Details

#countInteger (readonly)

Returns The number of users that have reacted with this emoji.

Returns:

  • (Integer)

    The number of users that have reacted with this emoji.



10
11
12
# File 'lib/rubycord/reaction.rb', line 10

def count
  @count
end

#emojiRubyCord::Emoji, RubyCord::PartialEmoji (readonly)

Returns The emoji that was reacted with.

Returns:



12
13
14
# File 'lib/rubycord/reaction.rb', line 12

def emoji
  @emoji
end

#meBoolean (readonly) Also known as: me?, reacted?

Returns Whether client user reacted with this emoji.

Returns:

  • (Boolean)

    Whether client user reacted with this emoji.



16
17
18
# File 'lib/rubycord/reaction.rb', line 16

def me
  @me
end

#messageRubyCord::Message (readonly)

Returns The message that this reaction is on.

Returns:



14
15
16
# File 'lib/rubycord/reaction.rb', line 14

def message
  @message
end

Instance Method Details

#fetch_usersAsync::Task<Array<RubyCord::User>>

Fetch the user that reacted with this emoji.

Parameters:

Returns:

  • (Async::Task<Array<RubyCord::User>>)

    The users that reacted with this emoji.



39
40
41
# File 'lib/rubycord/reaction.rb', line 39

def fetch_users(...)
  message.fetch_reacted_users(@emoji, ...)
end