discord js await message

Solutions on MaxInterview for discord js await message by the best coders in the world

showing results for - "discord js await message"
Frieda
22 Feb 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                            });
Louisa
01 Jul 2020
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    })
Emil
26 Jan 2017
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
wait for response discord botdiscord js await answerhow to use await message discord jsdiscord js how to use await messagesmessage wait discord jsdiscord js v12 await replyd js v12 reaction collector filterasync message discord jswait for reply discord jsawait for message discord jsdiscord js v12 await messagediscord py wait fordiscord bot wait for response discord jscollect reactions discord jshow to await a message in discord jshow to make a bot await a message discord jsdiscord js 12 ask follow up questionsawait message response discordjsdiscord js 23awaitmessagesdiscord js await messagediscord js message awaitdiscordjs await for a replyhow to reply to a message in discord jsdiscord js docs await messagemessage await discord js full tutorialdiscord js message replydiscord js wait for user responsediscord js reply to messagediscord await message replyhow to await button and message discord jsdiscordjs wait for responsediscord js await message discord js await message await message from autho discord jsdiscordjs 12 wait for messagewait for mesage to be sent discord jsawait reply discord jsawait messages discordkshow to await a message on discordhow to use await message in discord jshow to make discord bot wait for answersdiscord bot wait timeasync message discord jsdiscord js await message sendawait messages not working discord js how to await a message discord jsdiscord js wait for messagediscord bot await messagehow to await a message in discordjsdiscord js how listen for next messagesdiscord js async message eventdiscord js await messages maahawait response discord jsawait message discord jsnode js await messages discord doesnt waitawait a new message discord jsdiscord bot wait for messagediscord js bot wait for replyawait message discord jsawait message discordjsdiscord js dm await messagewait a reply from a user after an embed discord jshow to await messages discord jsawait messages in discord jsdiscordjs await messagediscord bot js wait for next messagehow to wait for message discord jshow to await a discord message disvcord jsdiscord js how to wait for a responseawait messages discord jsdiscord js wait for messagereaction collector filterdiscord js await for messagediscord js wait for response of message authordiscord message awaitdiscord js await messageshow to check if the message was a reply to an early message discord jsasync discord js on messageawait messageswait for confirmation discord jsdiscord bot wait for responsehow to await a message discord jsawait messages intend discord jsawait messages discordjsawait messages discord jshow to wait for a message discord jsdiscord js await messagesdiscord js async messagehow to make bot wait for dm messages discord jshow to await message discord jsbot doesn 27t collect messages from user with await discord jsif user replys to command discord jswait for message discord jshow to use await messages in discord jsdiscord js wait for replyawait message from anyone discord jshow to make your bot wait for a response on discord jsdiscord bot make function wait for responsediscord js await message