Discord.py client.join_voice_channel() has changed but I try to match the new documentation and it still doesn’t work!

Asked

Viewed 84 times

-1

Hello! I’m starting to practice Python in addition to the videos classes I try to practice creating some bots for DISCORD and trying to understand the library that is used. But my code to add the bot to the channel:

@client.event
async def on_message(message):
    if message.content.startswith('.conectar'):
        canal = message.author.voice.voice_channel
        await client.join_voice_channel(canal)

Always typing the . connect, it generates an error in the console (I know Discord.py has updated, but I’ve tried everything and do not understand the reason for errors in this part) I already tried to change client.join_voice_channel for Voicechannel.connect as it says in the documentation, but then it generates another error, something to do with "Member". Who can help me I will be extremely grateful!

1 answer

0

I myself, studying and trying everything I ended up finding the problem, IT IS VERY SIMPLE, I will comment right here to help anyone who has the problem:

    if message.content.startswith('.brota'):
        canal = message.author.voice.channel
        await message.channel.send("Entrando para soltar uma somzera...")
        await canal.connect()

Just compare the 2 codes and you will understand the small problems.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.