Epi*_*edy 0 node.js discord.js
我有一个关于 Discord.js 的问题。如何从消息中删除特定用户的反应?
我试图用这个代码这样做:
// Now known as 'messages.fetch'.
message.channel.fetchMessage(MessageID).then(m => {
m.reactions.remove(UserID);
});
Run Code Online (Sandbox Code Playgroud)
但它根本不会消除用户的反应。难道我做错了什么?
任何帮助,将不胜感激。
由于这个问题很吸引人,我决定发布对我有用的内容
删除特定用户的特定反应
// 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");
Run Code Online (Sandbox Code Playgroud)
注意:如果使用旧版本的 discord.js,只需替换channel.messages.fetch为channel.fetchMessage
| 归档时间: |
|
| 查看次数: |
20158 次 |
| 最近记录: |