How to check if user is talking
I know I should use the SpeakingMap from @discordjs/voice, but idk how to set it up to work.
connection.receiver.speaking.users returns the currently speaking users, mapped to the milliseconds since UNIX epoch at which they started speaking.
connection.receiver.speaking.users[uncaughtException]: TypeError: Cannot read properties of undefined (reading 'receiver')
at Timeout._onTimeout (D:\Boty\Frog bot\events\ready.js:11:44)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7)undefined const connection = getVoiceConnection(bot.config.guildId) // bot.config.guildId returns a guild id
setInterval(()=>console.log(connection.receiver.speaking.users),1000) setInterval(()=>{
const connection = getVoiceConnection(bot.config.guildId)
console.log(connection)
},1000)