It occurs only rarely, so the pattern is unclear.
It depends on the data sent from the Discord server.
[DEBUG] discord.gateway: Voice websocket frame received: {'op': 8, 'd': {'v': 4, 'heartbeat_interval': 13750.0}}
[DEBUG] discord.gateway: Voice websocket frame received: {'op': 2, 'd': {'streams': [{'type': 'video', 'ssrc': 193186, 'rtx_ssrc': 193187, 'rid': '', 'quality': 0, 'active': False}], 'ssrc': 193185, 'port': 50002, 'modes': ['aead_aes256_gcm_rtpsize', 'aead_xchacha20_poly1305_rtpsize'], 'ip': '35.213.101.214', 'experiments': ['fixed_keyframe_interval']}}
[DEBUG] discord.gateway: received packet in initial_connection: b'(hidden)'
[DEBUG] discord.gateway: detected ip: (hidden) port: (hidden)
[DEBUG] discord.gateway: received supported encryption modes:
[ERROR] __main__: list index out of range
Traceback (most recent call last):
File "/home/ubuntu/test/vc_test.py", line xxx, in connect_vc
await target.connect(timeout=10, reconnect=True)
File "/usr/local/lib/python3.11/dist-packages/discord/abc.py", line 1994, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "/usr/local/lib/python3.11/dist-packages/discord/voice_client.py", line 404, in connect
self.ws = await self.connect_websocket()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/discord/voice_client.py", line 375, in connect_websocket
await ws.poll_event()
File "/usr/local/lib/python3.11/dist-packages/discord/gateway.py", line 945, in poll_event
await self.received_message(utils._from_json(msg.data))
File "/usr/local/lib/python3.11/dist-packages/discord/gateway.py", line 862, in received_message
await self.initial_connection(data)
File "/usr/local/lib/python3.11/dist-packages/discord/gateway.py", line 916, in initial_connection
mode = modes[0]
~~~~~^^^
IndexError: list index out of range
Summary
Unable to connect to voice channel due to "list index out of range" error
Reproduction Steps
It occurs only rarely, so the pattern is unclear.
It depends on the data sent from the Discord server.
Minimal Reproducible Code
Expected Results
Connected to voice channel
Actual Results
Intents
guilds, message_content, guild_messages, voice_states
System Information
Checklist
Additional Context
No response