今天就开始编码并查看一些示例。尝试制作任务给予者机器人,但在尝试添加更多选择后,输入无法正常工作。
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!');
});
}); }})
没有错误消息,它无法正常运行。