I'm trying to make a discord bot that automatically mutes a user when they begin speaking (prank on a friend). However, I'm having a hard time determining how to use the 'speaking' portion of this code:
client.on('guildMemberSpeaking', (member, speaking) => {
console.log(member, speaking);
if (member.id == 'id-here' && speaking){
member.voice.setMute(true);
}
I found out that speaking is no longer a boolean in discord.js v12, and has been changed to a class. My question is: how can I read this value and use it in a logical statement to determine if a user is speaking? Thanks