Rei-x / discord-speech-recognition

Speech to text extension for discord.js
https://npmjs.com/package/discord-speech-recognition
MIT License
57 stars 22 forks source link

Suggestion: Filter out sounds from other bots #19

Closed lmmfranco closed 2 years ago

lmmfranco commented 2 years ago

Having a music/sound bot in the same channel can spam the speech recognition with useless requests. Would be nice to have a setting (or even by default) to ignore messages from bots.

Rei-x commented 2 years ago

You can make a pull request for this feature. Basically add checking if user is a bot in handleSpeechEvent (of course it's only my suggestion, you can figure out something by yourself) https://github.com/Rei-x/discord-speech-recognition/blob/f5858d707b61ae4f413ec88f6104fb94e748b24b/src/bot/events/speech.ts#L27

How to check if user is a bot?

client.users.cache.get(userId).bot // returns true when user is a bot

To add another options to bot modify this interface: https://github.com/Rei-x/discord-speech-recognition/blob/f5858d707b61ae4f413ec88f6104fb94e748b24b/src/bot/speechOptions.ts#L13-L21

Here you can specify default options: https://github.com/Rei-x/discord-speech-recognition/blob/f5858d707b61ae4f413ec88f6104fb94e748b24b/src/bot/addSpeechEvent.ts#L22-L26

I will be more than happy to review your PR and also by contributing to this repository you will get a chance to win a t-shirt in hacktoberfest event - read more here https://hacktoberfest.digitalocean.com/

Rei-x commented 2 years ago

Added in #25