Open codeofdusk opened 10 months ago
I'm not entirely sure why discord is sending a second VOICE_SERVER_UPDATE
event but it seems that's what's getting the code into a bad state. It doesn't seem to be related to joining from the event or from an automatic voice region channel. Does connecting work if it's simply called from a command, like so?
@commands.command()
async def join(self, ctx):
if not ctx.voice:
await ctx.author.voice.channel.join()
For reference, this is what my logs of connecting to voice look like.
Does connecting work if it's simply called from a command
@imayhaveborkedit Yes, it does.
I believe this is occuring because you have 2 instances of your bot running with this same on_voice_state_update listener. Can you double check you don't have 2 instances of your bot running?
Can you double check you don't have 2 instances of your bot running?
@EvieePy I'm certain that I only have one instance running.
That was the only way I was able to reproduce this issue so far. I will keep trying, but in the mean time, you could reset your bots tokens just to be certain, as this should disconnect any stray instances running.
I think I can fix this specific issue for you but it's not much more than a band-aid fix unless I can figure out why you get two voice_server_update events. Regardless if multiple instances cause this issue for you or not, this wasn't something I tested when I wrote this code.
One other question, is the token value in both of those voice_server_update payloads the same?
is the token value in both of those voice_server_update payloads the same?
@imayhaveborkedit Yes, it is.
Any updates on this issue? I'm still able to reproduce it as of 425edd2e10b9be3d7799c0df0cd1d43a1a34654e.
I am having this issue as well.
I am also having this issue (Python 3.9.0, discord.py 2.0.1). Never seems to return from await channel.connect()
edit: ignore me, forcing discord.py to update to 2.3.2 via pip install -U discord.py[voice]
fixed it
Summary
As of latest master, my bot can't connect to a voice channel and play audio. This works fine on 2.3.2.
Reproduction Steps
Commands.Cog
added.Minimal Reproducible Code
Expected Results
connect
returns avoice_client
with which I'm able to play audio.Actual Results
connect
never returns, and I get this debug log.Intents
System Information
Checklist
Additional Context
Discussion started at https://github.com/Rapptz/discord.py/issues/9460#issuecomment-1783643755.