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

#count -> Integer (readonly)

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

Returns:

  • (Integer)

    The number of users that have reacted with this emoji.



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

def count
  @count
end

#emoji -> Discorb::Emoji, Discorb::PartialEmoji (readonly)

Returns The emoji that was reacted with.

Returns:



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

def emoji
  @emoji
end

#me -> Boolean (readonly) Also known as: me?, reacted?

Returns Whether client user reacted with this emoji.

Returns:

  • (Boolean)

    Whether client user reacted with this emoji.



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

def me
  @me
end

#message -> Discorb::Message (readonly)

Returns The message that this reaction is on.

Returns:



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

def message
  @message
end

Instance Method Details

#fetch_users -> Async::Task<Array<Discorb::User>>

Fetch the user that reacted with this emoji.

Parameters:

Returns:

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

    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