I'm using discord.py to create a music bot, but I'm having trouble connecting the bot to a voice channel. Im using a Cog to seperate the music features from the rest.
@commands.command()
async def join_voice(self, ctx):
channel = ctx.author.voice.channel
print(channel.id)
await self.client.VoiceChannel.connect()
But I get the error:
AttributeError: 'NoneType' object has no attribute 'channel'
I've looked all through the docs and all the similar questions on here and still no solutions!
Could someone help please?