1
私はボットをこの場合直接メッセージを待つようにしています。この場合は直接メッセージで同じユーザーに返信します。ダイレクトメッセージのdiscordでユーザーからのメッセージを待っていますjs
私はmessage.author.awaitMessages
を使用しようとするが、コンソール・リターン:
TypeError: message.author.awaitResponse is not a function
message.author.send('Write your Name')
.then(function(){
message.channel.awaitMessages(response => message.content, {
max: 1,
time: 300000000,
errors: ['time'],
})
.then((collected) => {
message.author.send(`Your Name is: ${collected.first().content}`);
})
.catch(function(){
message.channel.send('You didnt write your name');
});
});
}
message.author.sendを呼び出している間に、 'message'が確かに変数で、' msg'ではないことを確認できますか? Discord.js hello worldは 'client.on( 'message'、msg)=> {'を使います。あなたのケースでは、ここで 'msg'を' message'に変更する必要があると思います –