Skip to content
SinisterRectus edited this page Dec 5, 2019 · 7 revisions

extends Container

Represents an emoji that has been used to react to a Discord text message. Both standard and custom emojis can be used.

Instances of this class should not be constructed by users.

Properties Inherited From Container

Name Type Description
client Client A shortcut to the client object to which this container is visible.
parent Container/Client The parent object of to which this container is a child. For example, the parent of a role is the guild in which the role exists.

Properties

Name Type Description
count number The total number of users that have used this reaction.
emojiHash string The discord hash for the emoji used in this reaction. This will be the raw string for a standard emoji.
emojiId string/nil The ID of the emoji used in this reaction if it is a custom emoji.
emojiName string The name of the emoji used in this reaction. This will be the raw string for a standard emoji.
emojiURL string/nil string The URL that can be used to view a full version of the emoji used in this reaction if it is a custom emoji.
me boolean Whether the current user has used this reaction.
message Message The message on which this reaction exists.

Methods Inherited From Container

__eq()

Defines the behavior of the == operator. Allows containers to be directly compared according to their type and __hash return values.

Returns: boolean


__tostring()

Defines the behavior of the tostring function. All containers follow the format ClassName: hash.

Returns: string


Methods

__hash()

Returns Reaction.emojiId or Reaction.emojiName

Returns: string


delete(id)

Parameter Type Optional
id User-ID-Resolvable

Equivalent to Reaction.message:removeReaction(Reaction)

This method always makes an HTTP request.

Returns: boolean


getUsers(limit)

Parameter Type Optional
limit number

Returns a newly constructed cache of all users that have used this reaction in its parent message. The cache is not automatically updated via gateway events, but the internally referenced user objects may be updated. You must call this method again to guarantee that the objects are update to date.

This method always makes an HTTP request.

Returns: SecondaryCache


getUsersAfter(id, limit)

Parameter Type Optional
id User-ID-Resolvable
limit number

Returns a newly constructed cache of all users that have used this reaction after the specified id in its parent message. The cache is not automatically updated via gateway events, but the internally referenced user objects may be updated. You must call this method again to guarantee that the objects are update to date.

This method always makes an HTTP request.

Returns: SecondaryCache


getUsersBefore(id, limit)

Parameter Type Optional
id User-ID-Resolvable
limit number

Returns a newly constructed cache of all users that have used this reaction before the specified id in its parent message. The cache is not automatically updated via gateway events, but the internally referenced user objects may be updated. You must call this method again to guarantee that the objects are update to date.

This method always makes an HTTP request.

Returns: SecondaryCache


Clone this wiki locally