Jess
DIAdiscord.js - Imagine an app
•Created by Jess on 2/2/2024 in #djs-voice
Bot recognizes speech event twice or more
I'm struggeling with following issue:
I created a bot that should recognize different voice commands and play audio according to the command. I'm working with discord-speech-recognition and @discordjs/voice. So far so good, everything works fine when I'm testing it. But when a friend of mine is testing it, the bot often recognizes the msg twice or even more times. He's using the mobile app, so I also tried it with my phone and still I have no problems. I followed the discord-speech-recognition example usage for discord.js v14
client.on(SpeechEvents.speech, (msg) => {
if(!msg.content) return;
console.log(msg.author.username+': '+msg.content);
//analyzing the msg and doing stuff according to the commands
}
Has anyone an idea what could cause the issue and how I can prevent it?
TIA 🙂2 replies