Closed cjlora closed 2 years ago
Okay, that was my bad. I updated simpleBot example and now it should work without crashing. Let me know if it helps you!
It seemed to not crash anymore, however it started to repeat the message multiple times
It also had this on the traceback which I patched by increasing the limit, however it still repeats the message multiple times
are you using the latest version of discord-speech-recognition? Can you show me te repository with the code?
edit: try to run npm install discord-speech-recognition
okay, simpleBot was using outdated version of discord-speech-recognition, it should work now
Yeah my bad, I didn't update it on my end. Apparently it outputs the message only once now, but it still seems to crash when it picks up inaudible sounds.
Here's the link to the repository: https://github.com/cjlora/tyrant-bot
you need to check if message is empty (because sometimes bot doesn't recognize speech properly) -> https://github.com/Rei-x/discord-speech-recognition/blob/main/examples/simpleBot/index.js#L27
client.on("speech", (msg) => {
if (!msg.content) return; // <- add this
[some code]
});
Okay, I'll try it out. Thanks dude!
no problem, if it works please close this issue and don't hesitate to ask if you have any more questions, have fun coding
I'm having a weird interaction when a certain person joins the channel however I don't know how to troubleshoot it. Here's the traceback.
is this person using web version of discord?
Yes the person is using a web version of discord.
unfortunately, I don't think that I can do anything with it, it's because of how @discordjs/voice handles voice connections, there is an open issue for this: https://github.com/discordjs/discord.js/issues/7647
and there is also open pull request, i think it should be fixed relatively quickly: https://github.com/discordjs/discord.js/pull/8277
Oh thank you dude. Anyways I'll close the issue now. Thanks for your time.
Hi there, I was trying out the simpleBot example and the bot crashes when it doesn't recognize a familiar word. I see that it throws something on traceback but it still stops the whole bot from functioning. I would really like to understand the code more and possibly put a try catch method so it prevents it from crashing. Thanks!