当我运行它时,awaitMessages没有接受我的输入。我正在尝试使用node.js和discord.js打造一个Discord机器人

时间:2019-05-27 08:17:47

标签: javascript bots discord new-operator

今天就开始编码并查看一些示例。尝试制作任务给予者机器人,但在尝试添加更多选择后,输入无法正常工作。

client.on('message',message => {     console.log(message.content);

if(message.content.startsWith(`${prefix}explore val`)) {
    //message.channel.send("Testing message.", { files: ["./quest/stone-men-2.gif"] });
    message.channel.send("test.");
    message.channel.send("test ");
    message.channel.send('What will be your course of action? This will await will be cancelled in 30 seconds. It will finish when you provide a message that goes through the filter the first time.')
        .then(() => {
            message.channel.awaitMessages(response => response.content === 'A', 'B', 'C', {
            max: 3,
            time: 30000,
            errors: ['time'],
    })
        .then((collected) => {
            message.channel.send(`The collected message was: ${collected.first().content}`);
    })
        .catch(() => {
            message.channel.send('There was no collected message that passed the filter within the time limit!');
    });

});     }})

没有错误消息,它无法正常运行。

0 个答案:

没有答案