moonstar-x / discord-tts-bot

A Text-to-Speech bot for Discord.
https://docs.moonstar-x.dev/discord-tts-bot
MIT License
98 stars 84 forks source link

Can't get the bot to speak in channel (Error status code 400) #31

Closed cash-bonus closed 3 years ago

cash-bonus commented 3 years ago

:confused: Question

I'm self hosting the bot, the bot is in the server and will join voice channels, but will not say anything with $say or $aeiou

:question: Additional Information

I already have ffmpeg installed and updated

image

moonstar-x commented 3 years ago

Hey there, are you hosting this on your own machine or in a VPS/Heroku-like service?

cash-bonus commented 3 years ago

Im hosting on my own raspberry pi

cash-bonus commented 3 years ago

It actually works for a minute now after i reinstall

cash-bonus commented 3 years ago

but when my friend tried it it started giving errors again

cash-bonus commented 3 years ago

for some strange reason if I stop the bot on my raspberry pi, re run the npm install command, and turn it back on it will start working again? The problem seems to happen when more than one person, or the same person on a different server, try to call the bot.

moonstar-x commented 3 years ago

Hmm, this is kinda weird. I can only assume it's got something to do with discord.js, in what country do you live? What happens if you go to this site?

moonstar-x commented 3 years ago

Oh wait hold on, by any chance, the text channel where you're trying to do the commands say or aeiou, does the bot have enough permissions to send messages?

Does the bot send a message saying "Joined (channel name)" in the text channel that you used to summon it?

cash-bonus commented 3 years ago

the bot does send messages

cash-bonus commented 3 years ago

i live in usa

moonstar-x commented 3 years ago

Kinda weird, the error sounds like it's coming from the message send since the bot doesn't log "received TTS for..." which means that it never got there in the first place, and since the error messages are exactly the same for aeiou and say, I imagine it would be due to the message sending failing but then again the error log would begin with DiscordAPIError normally.

I have a raspberry pi lying around, let me try running the bot from there.

moonstar-x commented 3 years ago

image

I have no clue what could be causing this. Only thing I can imagine is that you may be having troubles in your own network or your raspberry pi has trouble accessing the required resources.

I tried running the bot from a raspberry pi, on two different servers and I can't get the error you're getting.

cash-bonus commented 3 years ago

Ah ok. I do have a seedbox running on the same pi so maybe it is a resource issue.

moonstar-x commented 3 years ago

Hmm, I'm not 100% sure about that. Maybe try waiting a bit then trying again?

Quite unfortunately I can't reproduce this issue on my own raspberry pi so I'm assuming it must be due to something on your setup/connection.

Sorry I can't help you any further. If you prefer, you can use the instance I'm hosting from my own server (invite link is in README).