Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using in multiple servers #13

Open
oktayozkan0 opened this issue Feb 3, 2023 · 2 comments
Open

using in multiple servers #13

oktayozkan0 opened this issue Feb 3, 2023 · 2 comments

Comments

@oktayozkan0
Copy link

how can i use this bot in multiple channels with different servers?
bot cant join different voice channels when connect to a voice channel and play music.

@jeremycanlas
Copy link

Hi not sure if you still need it but what worked for me is changing self.music_queue into a dictionary with ctx.guild.id as the key and the rest as the value just so that the music queue isn't all in one list. I had an issue where server#2's music also plays in server#1's music as well. Also change any reference of self.music_queue to self.music_queue[ctx.guild.id].

Another thing I changed was in the cogs specifically:
in the async def play_music(self, ctx): function

I changed the line from
if self.vc == None or not self.vc.is_connected():

to

voice_client = nextcord.utils.get(self.bot.voice_clients, guild=ctx.guild)
if self.vc == None or not voice_client:

I use nextcord but discord.py should work.

I might be wrong but seems like self.vc.is_connected() checks if your bot connected to any voice channel at all servers it is in so changing that should allow your bot to join different voice channels in different servers

@oktayozkan0
Copy link
Author

thank you so much, yes i still need it. i will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants