Reaction class

const reaction = new Reaction(data: MessageReaction, addon: Addon, _user: User);

constructor

The constructor of the Reaction class requires three arguments. The first argument must be an instance of the Discord.js MessageReaction class which provides the data for the Reaction class. The second argument must be an instance of the Zyno Bot Addons Addon class and defines for which addon the Reaction class should be created for. The third argument must be an instance of the Zyno Bot Addons User class and defines the user who reacted on the message.

Properties

id

The id of the emoji where the user reacted with and is a Twitter snowflake.

message

An instance of the Message class and defines the message where the user reacted on.

guild

An instance of the Guild class and defines the guild where the message was sent in where the user reacted on.

members

An instance of the Save class and provides the other members who reacted with this reaction on the message.

Save<id(string), Member>

emoji

An object which defines the emoji the user reacted with on the message.

{
    'name': string;
    'id': string | null;
    'animated': boolean | null;
    'string': string;
}

user

An instance of the User class and defines the user who reacted on the message with this reaction.

Functions

isCustomEmoji

reaction.isCustomEmoji() : boolean;

Returns a boolean which defines whether the emoji used to react on the message with is a custom emoji or a default emoji.

removeReaction

reaction.removeReaction(user?: User) : Promise<Reaction>;

Removes a reaction from the message. The function returns a Promise which returns an instance of the Reaction class with the updated data once it's been fulfilled.

Last updated