discord.js wait seconds
setTimeout(function(){
//Code
}, 5000); //time in milliseconds
discord.js wait seconds
setTimeout(function(){
//Code
}, 5000); //time in milliseconds
discord bot wait for response
let filter = m => m.author.id === message.author.id
message.channel.send(`Are you sure to delete all data? \`YES\` / \`NO\``).then(() => {
message.channel.awaitMessages(filter, {
max: 1,
time: 30000,
errors: ['time']
})
.then(message => {
message = message.first()
if (message.content.toUpperCase() == 'YES' || message.content.toUpperCase() == 'Y') {
message.channel.send(`Deleted`)
} else if (message.content.toUpperCase() == 'NO' || message.content.toUpperCase() == 'N') {
message.channel.send(`Terminated`)
} else {
message.channel.send(`Terminated: Invalid Response`)
}
})
.catch(collected => {
message.channel.send('Timeout');
});
})
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us