Answers for "discordjs await messages"

-1

discord.js await message

message.channel.awaitMessages(m => m.author.id == message.author.id,
    { max: 1, time: 30000 }).then(collected => {
        if (collected.first().content.toLowerCase() == 'yes') {
            message.reply('Shutting down...');
            client.destroy();
        }
        else
            message.reply('Operation canceled.');
    }).catch(() => {
        message.reply('No answer after 30 seconds, operation canceled.');
    });
Posted by: Guest on April-16-2021

Browse Popular Code Answers by Language