I am making a discord bot using the discord.py rewrite and I have recently run into a problem.
I have made a command to join a user's voice channel. The thing is, my command works perfectly fine when I run it on my local PC, but now that I'm trying to run it on a raspberry pi it fails when connecting to the voice channel.
I have tried installing all dependencies but I just can't get it to work.
Code for the command:
async def join(ctx):
channel = ctx.message.author.voice.channel
voice = get(bot.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
voice = await channel.connect()
await ctx.send("I joined the channel!")
There are no exceptions raised.
You are using a bad way to connect to the voice channel.
Try using this code.
It identify where the user is and connect in that voice channel.