3 months ago
I have issue with my discord bot it cant connect to VC and based on my analysis the problem is Railway due to network latency is there any help
3e6de7ce-253c-4831-9377-8873bbc36db5
33 Replies
3 months ago
Have you tried deploying in a different region?
Discord voice handshakes from Railway are still failing with ConnectionClosed … code 4006
3 months ago
Are you using discord.py?
no i am using pycord
do i need to use discord.py for railway?
3 months ago
No, was just curious.
https://github.com/Rapptz/discord.py/issues/10207
Other users faced similar issues as you reported.
Have you tried switching the region of the vc?
3 months ago
You can change voice chat region in channel settings > region override.
Ill try to switch to discord.py
Nvm cant switch to discord.py
3 months ago
whats the issue/logs?
3 months ago
are you using a self-bot?
3 months ago
or an actual discord bot?
3 months ago
whats the traceback? cause 4006 is discord invalidating the voice connection
3 months ago
not railway
3 months ago
your bot doesn’t have a processcommands method, which means the bot was created as a regular discord client instead of a commands bot. Every time a message arrives and your code runs bot.processcommands(message), Discord raises an AttributeError. If you aren’t using slash commands or commands at all, you shouldn’t call it on the client event (the process commands)
your logic for the voice connection is unstable, you don’t seem to check whether or not you are connected by voiceclient.isconnected() before doing anything with the audio, you’re proceeding anyway despite the connection failing
is_connected() returned False, but connect() succeeded. This is common on Railway due to network latency. Proceeding anyway… (is what appears from your logs)
3 months ago
overall from what I can tell, your logic is incorrect or flaky that it sometimes works and sometimes doesn’t
3 months ago
if you have a public git repo I can help you fix it, but if it’s private then I can only guide you on it