N
N
not important .2021-11-05 09:04:10
Node.js
not important ., 2021-11-05 09:04:10

Why doesn't voiceStateUpdate work anymore?

Previously, everything worked well, but now the bot does not react at all to the event, maybe someone knows?
Here is the code:

bot.on('voiceStateUpdate', (oldState, newState) => {

  console.log("GG")

  if (newState.channel == oldState.channel) return;

  if (oldState.channel && !newState.channel) {

      let embed = new Discord.MessageEmbed()
        .setColor('RED')
        .setDescription(`:sos: Участник **${oldState.member}**\n вышел из канала **${oldState.channel.name}**`)
        .setFooter(`Tsukuyomi Entertainment`)
      bot.channels.cache.get("833588850479726592").send(embed);

  }

  if (newState.channel && !oldState.channel) {

      let embed = new Discord.MessageEmbed()
        .setColor('GREEN')
        .setDescription(`:white_check_mark: Участник **${newState.member}**\n зашёл в канал **${newState.channel.name}**`)
        .setFooter(`Tsukuyomi Entertainment`)
      bot.channels.cache.get("833588850479726592").send(embed);

  }

  if (newState.channel && oldState.channel) {

      let embed = new Discord.MessageEmbed()
        .setColor('BLUE')
        .setDescription(`:arrow_right_hook: Участник **${newState.member}**\n переместился из канала **${oldState.channel.name}** в канал **${newState.channel.name}**`)
        .setFooter(`Tsukuyomi Entertainment`)
      bot.channels.cache.get("833588850479726592").send(embed);

  }
})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question