I have been trying to write a discord bot using discord.py
. VoiceChannel.connect()
works just like stated in the documents however VoiceChannel.disconnect()
doesn't work even though it is stated in the documents. I need to use to make the bot leave the voice channel. Below is the code.
elif message.content == ("/bind"):
channel = message.author.voice.channel
vc = await channel.connect()
elif message.content == ("/unbind"):
channel = message.author.voice.channel
vc = await channel.disconnect()
The error im getting is:
AttributeError: 'VoiceChannel' object has no attribute 'disconnect'
also I'm using @client.event instead of @client.command