Rayinator
Rayinator

Reputation: 45

Discord.py Disconnecting voice client ends when I disconnet from a different server

When I disconnect my bot from a channel, it stops all music in other channels. I'm currently using the create_ytdl_player() function to stream music. Any help?

Current Code:

elif message.startswith('~disconnect'):
for x in client.voice_clients:
    if x.server == msg.server:
        print("Found Server!")
        await x.disconnect()
        VoiceOn[msg.channel.server.id] = False #A Dictionary which I use to detect if music is currently playing in the server.
        break

Upvotes: 0

Views: 961

Answers (1)

khazhyk
khazhyk

Reputation: 1888

This is a known Discord bug, there's nothing you can do about it. https://github.com/Rapptz/discord.py/issues/477

(Re-launching the client should fix it, until the bot disconnects again).

The only real workaround here is to have a different account per voice session. It's not super elegant (and does not scale very well).

Upvotes: 1

Related Questions