Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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 :: mac node change version 16 
Javascript :: discord js check if person banned 
Javascript :: svg to string javascript 
Javascript :: bootstrap modal clear all fields 
Javascript :: method to look for objects in arrays by id 
Javascript :: number of repetition in an array javascript 
Javascript :: chartjs min 
Javascript :: conditional field validation with Yup 
Javascript :: windows how to set process.env variables 
Javascript :: chrome add a bookmark that appends to current url 
Javascript :: Creating a Proxy Object 
Javascript :: javascript random numbers 
Javascript :: string to jsonobject gson 
Javascript :: js new date short format 
Javascript :: get object key from value javascript 
Javascript :: javascript run command 
Javascript :: javascript format float 
Javascript :: convert string in hh:mm am/pm to date js 
Javascript :: Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type 
Javascript :: typing animation in js 
Javascript :: read file size javascript 
Javascript :: js C:fakepath 
Javascript :: append array js 
Javascript :: dictionary in javascript 
Javascript :: javascript force precision to 2 decimal numbers 
Javascript :: retunr empty new promise 
Javascript :: js events 
Javascript :: moment().toDate(); 
Javascript :: javascript string interpolation 
Javascript :: index of value in array 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =