Class: Discorb::Reaction

Inherits:
DiscordModel show all
Defined in:
lib/discorb/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:

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



9
10
11
# File 'lib/discorb/reaction.rb', line 9

def count
  @count
end

#emojiDiscorb::Emoji (readonly)

Returns The emoji that was reacted with.

Returns:

  • The emoji that was reacted with.



11
12
13
# File 'lib/discorb/reaction.rb', line 11

def emoji
  @emoji
end

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

Returns Whether client user reacted with this emoji.

Returns:

  • Whether client user reacted with this emoji.



15
16
17
# File 'lib/discorb/reaction.rb', line 15

def me
  @me
end

#messageDiscorb::Message (readonly)

Returns The message that this reaction is on.

Returns:

  • The message that this reaction is on.



13
14
15
# File 'lib/discorb/reaction.rb', line 13

def message
  @message
end

Instance Method Details

#fetch_usersArray<Discorb::User>

Fetch the user that reacted with this emoji.

Parameters:

  • The emoji to fetch.

  • The maximum number of users to fetch. nil for no limit.

  • The ID of the user to start fetching from.

Returns:

  • The users that reacted with this emoji.



38
39
40
# File 'lib/discorb/reaction.rb', line 38

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