Answers for "discord.py wait for"

1

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');
        });
    })
Posted by: Guest on December-02-2020
1

discord.py fetch channel

await client.fetch_channel(channelId)
Posted by: Guest on January-23-2021
1

get guild from a channel discord py

channel.guild
Posted by: Guest on January-12-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language