【发布时间】:2022-01-14 00:43:13
【问题描述】:
这个小代码的目的是将消息更改为用户对基本消息的反应中使用的表情的名称。这适用于discord.js v12 ...我完全不知道为什么这在v13中不起作用。收集器在停止收集时确实会发送正确的结束消息(如果我将它放在计时器上),但我放在侦听器中的任何代码都不会在反应时执行。我已经用 console.log 等进行了测试。很感谢任何形式的帮助! (我确实启用了所有正确的意图。)
client.on("message", (message) => {
if (message.content.toLowerCase() === prefix + "reaction") {
message.channel.send("react to this").then(m => {
// I know the filter here is not useful but it's for the future
const filter = (reaction, user) => {
return true
}
const collector = message.createReactionCollector({ filter }); //edited form m to filter
collector.on("collect", (r) => {
m.edit(r.emoji.name)
})
collector.on("end", (collected) => {
m.edit("reaction listening stopped.")
})
})
}
})
【问题讨论】:
标签: node.js discord.js