从fetchMessage移除用户反应? -Discord JS [英] Remove a users reaction from fetchMessage? - Discord JS

查看:89
本文介绍了从fetchMessage移除用户反应? -Discord JS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Discord JS
有疑问我该如何从提取的消息中删除特定用户的反应?
我尝试了此

I have a question with Discord JS How do I remove a specific users reaction from a fetched message? I tried this

message.channel.fetchMessage(messageID).then(m => {
m.reactions.remove(UserID)
})

但它不会删除实际反应。
感谢您的帮助。

But it doesn't remove the actual reaction. Help would be appreciated thanks.

推荐答案

由于这个问题吸引了很多人,所以我决定发布为我工作

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

删除特定用户的特定反应

// 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.fetchMessage(MessageID);

msg.reactions.resolve("REACTION EMOJI, 
REACTION OBJECT OR REACTION ID").users.remove("ID OR OBJECT OF USER TO REMOVE");

注意:如果使用master,只需替换 channel.fetchMessage channel.messages.fetch

这篇关于从fetchMessage移除用户反应? -Discord JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆