I am giving my bot music aspects, and I am working on joining and leaving voice channels.
I have searched a lot on the internet before asking, from Stack Overflow, Reddit etc. However, none of these solutions worked or were what I needed.
My code:
@commands.command(pass_context=True)
async def disconnect(self, ctx):
server = ctx.message.guild.voice_client
await server.disconnect()
Things to note:
This code is from StackOverflow, yet it doesn't work, my original code didn't work either
This is in a seperate file from my join command
However I am using cogs, and I have used heritage to basically link the 2, so even if they are in seperate files (For organization resaons), they are still part of the same class (cog) called music.
How should I fix my code or change it so that it works? Thanks!