我正试图制作一个不和谐的收藏家:
let user = message.author;
let guest = message.mentions.users.first()
const collector = new Discord.MessageCollector(message.channel, m => m.author.id === message.author.id || m.author.id === guest.id, {
time: 60000,
max: 100,
maxMatches: 100
});
collector.on('collect', message => {
if (message.content == "a" && m.author.id === message.author.id) {
message.channel.send("b")
} else if (message.content == "a" && m.author.id === guest.id) {
message.channel.send("c")
}
})
当 USER 编写此命令(prefix + command + @guest
)并说“ a”时,机器人将以“ b”回复,如果 GUEST 说“机器人会回复“ c”。
问题是m
没有定义,我该如何解决?
答案 0 :(得分:0)
您需要更改此内容
collector.on('collect', message => {...});
对此:
collector.on('collect', m => {...});
然后message
是原始邮件,m
是收集的邮件。