Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on("messageReactionAdd", async (reaction, user) => {
- if (user.bot) return;
- const isRelevant = await reactionController.isRelevant(reaction); // Checks if the reaction was to a specific message
- if (isRelevant) {
- // Saves user to the DB.
- } else {
- reaction.users.remove(user); // Fires messageReactionRemove indistinguishable from a manual removal
- }
- });
- client.on("messageReactionRemove", async (reaction, user) => {
- // user.bot is always false here, because the event registers whose emoji or reaction emoji was removed. None reaction nor user are partials.
- const isRelevant = await reactionController.isRelevant(reaction);
- if (isRelevant) {
- // Remove user from the database
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement