I'm interested in making a discord bot using python. Im trying to make a bot that could join voice channel. This is my code, I already ran it but it's not working. I already did some research on the internet, but I think this code is completely fine?
#Join Command
@client.command()
async def join(ctx):
if(ctx.author.voice): #If in voice channel
channel = ctx.author.voice.channel
await channel.connect()
else: #If not in voice channel
await ctx.send("You must be in voice channel first !")
So have any idea why my code won't work? This is my first time using python btw.