Reaction

Reaction

Represents a reaction belonging to a message.

Constructor

new Reaction(client, data, options)

Description:
  • Creates the structure for a reaction.

Source:
See:
Parameters:
Name Type Description
client Client

The client instance.

data Object

The raw reaction data from Discord.

options Object

Additional options for this structure.

Properties
Name Type Description
guildId String

The id of the guild that the reaction belongs to.

Members

(readonly) count :Number

Description:
  • The number of reactions to this message.

Source:

The number of reactions to this message.

Type:
  • Number

(readonly) emoji :Emoji

Description:
  • The emoji used for the reaction.

Source:

The emoji used for the reaction.

Type:

(readonly, nullable) guild :Guild

Description:
  • The guild that this reaction belongs to.

Source:

The guild that this reaction belongs to.

Type:

(readonly) guildId :String

Description:
  • The id of the guild that this reaction belongs to.

Source:

The id of the guild that this reaction belongs to.

Type:
  • String

(readonly, nullable) initialReactor :String

Description:
  • The user who added the first reaction.

Source:

The user who added the first reaction.

Type:
  • String

(readonly) reacted :Array.<(Member|String)>

Description:
  • The member objects of the members who reacted. Returns the user id of the member cannot be found.

Source:

The member objects of the members who reacted. Returns the user id of the member cannot be found.

Type:

(readonly) reactedIds :Array.<String>

Description:
  • The user ids of the users who reacted.

Source:

The user ids of the users who reacted.

Type:
  • Array.<String>

Methods

_addReactor(userId)

Description:
  • Adds a user to the list of reactors.

Source:
Parameters:
Name Type Description
userId String

The id of the user to add as a reactor.

Throws:
TypeError

_removeReactor(userId)

Description:
  • Removes a user from the list of reactors.

Source:
Parameters:
Name Type Description
userId String

The id of the user to add as a reactor.

Throws:
TypeError

toJSON(format) → {Object}

Description:
  • Returns the JSON representation of this structure.

Source:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object

toString()

Source: