title: How to get speaking status in real time using Discord.js v13
body: <p>I try to detect in real-time whether each member is speaking or not on a voice channel using discord.js v13.
  In other words, I want to reproduce the green circle of discord in my application.
  However, I couldn't find a suitable code example or article.
  Could you give me some advice?</p>
  <p>Edit:</p>
  <p>Based on the advice, I was able to solve it.
  <a href="https://github.com/discordjs/voice/tree/main/examples/recorder" rel="nofollow noreferrer">The example of Recorder BOT</a> was useful.
  A code example is shown below.</p>
  <pre><code>const { Client, Intents, VoiceChannel } = require('discord.js')
  const { joinVoiceChannel, getVoiceConnection, entersState, VoiceConnectionStatus } = require('@discordjs/voice');
  const client = new Client({ intents: ['GUILD_VOICE_STATES', 'GUILD_MESSAGES', 'GUILDS'] });
  
  client.on(&quot;messageCreate&quot;, async (message) =&gt; {
    if(message.content.toLowerCase() === &quot;test&quot;) {
      var connection = getVoiceConnection(message.guildId)
      if(!connection){
        connection = joinVoiceChannel({
          channelId: message.member.voice.channelId,
          guildId: message.guildId,
          adapterCreator: message.guild.voiceAdapterCreator,
          selfDeaf: false,
          selfMute: true,
        });
      }
      try {
        await entersState(connection, VoiceConnectionStatus.Ready, 20e3);
        connection.receiver.speaking.on(&quot;start&quot;, (userId) =&gt; {
          console.log(  `${userId} start`  );
        });
        connection.receiver.speaking.on(&quot;end&quot;, (userId) =&gt; {
          console.log(  `${userId} end`  );
        });
        console.log(  &quot;Ready&quot;  );
      } catch (error) {
        console.warn(error);
      }
  
    }
  });
  
  client.login('YOUR-TOKEN')
  </code></pre>