我有一个设置命令,其中设置在dm中进行。发送第一个消息工作,但每当我发送机器人它不检测我的消息。代码:
const filter = m => m.content;
message.author.dmChannel.awaitMessages(filter, {
max: 1,
time: 60000,
errors: ["time"]
}).then(collected => {
collected.reply("message collected message");
}.catch(() => message.author.send("ran out of time message")
当时间用完时,提示时间已到
我也试过这个,但它也没有工作
const filter = m => m.content;
message.author.dmChannel.awaitMessages({
filter,
max: 1,
time: 60000,
errors: ["time"]
}).then(collected => {
collected.reply("message collected message");
}.catch(() => message.author.send("ran out of time message")
TextChannel.awaitMessages()
现在只接受一个参数。这包括对象中的filter属性。把它改成这样就可以了:
const filter = m => m.content;
message.author.dmChannel.awaitMessages({
filter,
max: 1,
time: 60000,
errors: ["time"]
})