showing results for - "await message discord js"
Nick
11 May 2019
1 message.channel.awaitMessages(m => m.author.id == message.author.id,
2                            {max: 1, time: 30000}).then(collected => {
3                                    // only accept messages by the user who sent the command
4                                    // accept only 1 message, and return the promise after 30000ms = 30s
5
6                                    // first (and, in this case, only) message of the collection
7                                    if (collected.first().content.toLowerCase() == 'yes') {
8                                            message.reply('Shutting down...');
9                                            client.destroy();
10                                    }
11
12                                    else
13                                            message.reply('Operation canceled.');      
14                            }).catch(() => {
15                                    message.reply('No answer after 30 seconds, operation canceled.');
16                            });
Claudio
01 Sep 2017
1
2let filter = m => m.author.id === message.author.id
3    message.channel.send(`Are you sure to delete all data? \`YES\` / \`NO\``).then(() => {
4      message.channel.awaitMessages(filter, {
5          max: 1,
6          time: 30000,
7          errors: ['time']
8        })
9        .then(message => {
10          message = message.first()
11          if (message.content.toUpperCase() == 'YES' || message.content.toUpperCase() == 'Y') {
12            message.channel.send(`Deleted`)
13          } else if (message.content.toUpperCase() == 'NO' || message.content.toUpperCase() == 'N') {
14            message.channel.send(`Terminated`)
15          } else {
16            message.channel.send(`Terminated: Invalid Response`)
17          }
18        })
19        .catch(collected => {
20            message.channel.send('Timeout');
21        });
22    })
Maja
13 Feb 2018
1message.channel.awaitMessages(m => m.author.id == message.author.id,
2    { max: 1, time: 30000 }).then(collected => {
3        if (collected.first().content.toLowerCase() == 'yes') {
4            message.reply('Shutting down...');
5            client.destroy();
6        }
7        else
8            message.reply('Operation canceled.');
9    }).catch(() => {
10        message.reply('No answer after 30 seconds, operation canceled.');
11    });
queries leading to this page
await messagesdiscord js async on messagediscord js await message sendhow to wait for message discord jsawait messages not working discord js discord bot wait for response discord jsdiscord js message awaitdiscord js how to use await messageshow to await a message in discordjsdiscordjs wait for responsehow to check if the message was a reply to an early message discord jsdiscord js await messagesdiscord bot ask wait for responsediscord message awaithow to await messages discord jsif user replys to command discord jsdiscord js await messageswait a reply from a user after an embed discord jsdiscord js 23awaitmessagesawait messages intend discord jsdiscord js docs await messagewait for message discord oydiscord js await messaged js v12 reaction collector filternode js await messages discord doesnt waithow to await a message discord jsawait message component discord jsdiscord bot how to wait a responseawait messages discordksawait messages discord jsdiscord js async messagediscord bot wait timediscord js async message eventasync message discord jsawait response discord jsdiscord js v12 await replybot doesn 27t collect messages from user with await discord jsdiscord js await messages maahdiscord js wait for replydiscord js await answerdiscordjs await for a replyhow to await a discord message disvcord jsdiscord bot js wait for next messagehow to make discord bot wait for answersdiscord js v12 await messageawait a new message discord jsdiscord js how listen for next messageshow to make bot wait for dm messages discord jsawait reply discord jsdiscord bot make function wait for responsediscord js reply to messageawait for message discord jshow to reply to a message in discord jswait for message discord jswait for reply discord jsdiscord js wait for response of message authorawait messages discordjsdiscordjs 12 wait for messagediscord js await for messagehow to wait for a message discord jsdiscord js dm await messagemessage await discord js full tutorial discord js await message collect reactions discord jswait for mesage to be sent discord jshow to use await messages in discord jsawait messages discord jshow to use await message discord jsdiscord js await messagediscord js message replyhow to await message discord jsawait message discordjsawait messages in discord jsdiscord await message replymessage await discord jsdiscord bot wait for responsediscord js 12 ask follow up questionsawait message from autho discord jsdiscord js how to wait for a responsediscord bot waitawait message from anyone discord jswait for confirmation discord jsmessage await discord jshow to await a message on discordasync message discord jsreaction collector filterasync discord js on messageawait message discord jshow to await button and message discord jsdiscord await messagesdiscord bot await messagediscord js bot wait for replyhow to await a message discord jsdiscord js wait for messagediscord bot wait for messagediscord js wait for user responsehow to make a bot await a message discord jsmessage wait discord jshow to use await message in discord jswait for response discord botdiscord js wait for messageawait message response discordjshow to make your bot wait for a response on discord jshow to await a message in discord jsdiscord py wait forawait message discord jsdiscordjs await messageawait message discord js