Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

remove a user from a reaction discord.js

<Message>.reactions.resolve(EMOJI).users.remove(USER)
<MessageReaction>.users.remove(USER)
Comment

discord.js remove reaction

Since this question is getting a lot of attraction, I decided to post what worked for me

Remove Specific User's Specific Reaction

// Channel = the channel object of the message's original channel
// MessageID = ID of the message, if hard coding, put around quotations eg: "1234"

const msg = await channel.messages.fetch(MessageID);

msg.reactions.resolve("REACTION EMOJI, 
REACTION OBJECT OR REACTION ID").users.remove("ID OR OBJECT OF USER TO REMOVE");
Note: If using an older version of discord.js, simply replace channel.messages.fetch with channel.fetchMessage
Comment

discord js remove reaction from user

const userReactions = message.reactions.cache.filter(reaction => reaction.users.cache.has(userId));

try {
	for (const reaction of userReactions.values()) {
		await reaction.users.remove(userId);
	}
} catch (error) {
	console.error('Failed to remove reactions.');
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: falsy values in javascript 
Javascript :: how to generate random color hexcodes for javascript 
Javascript :: disable other options in select except the selected 
Javascript :: jquery date 
Javascript :: nodejs save blob file 
Javascript :: toastr options 
Javascript :: closures in javascript 
Javascript :: react native dotenv 
Javascript :: creating react app using npx 
Javascript :: react onchange handler 
Javascript :: reset select2 jquery | clear select2 option value 
Javascript :: js how to convert vh to pixel 
Javascript :: reverse integer in javascript 
Javascript :: javascriot function 
Javascript :: convert date to unix timestamp javascript 
Javascript :: javascript include property array object 
Javascript :: 404 page in react 
Javascript :: random color 
Javascript :: how to use cookies in react js 
Javascript :: using apis in javascript 
Javascript :: number to float js 
Javascript :: how to replace all occurrences of a string in javascript 
Javascript :: how to run a function infinite time in javascript 
Javascript :: push values to state array class react 
Javascript :: js operators 
Javascript :: why can i put comments in some json files 
Javascript :: discord.js presence update 
Javascript :: javascript como recorrer un array multidimensional 
Javascript :: destructuring objects 
Javascript :: jquery option second 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =