I am trying to connect my bot to a voice channel using discord.py but it is not working to me so well... any help on how I can improve that?
@bot.command(pass_context=True)
async def join(ctx):
channel = ctx.author.voice.channel
await bot.join_voice_channel(channel)
Error :
Ignoring exception in command join:
Traceback (most recent call last):
File "C:\Users\matan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:/Users/matan/Desktop/python/discord bot 1/Main.py", line 926, in join
await bot.join_voice_channel(channel)
AttributeError: 'Bot' object has no attribute 'join_voice_channel'
I also have this code :
@bot.command()
async def play(ctx, url : str, channel = discord.VoiceChannel):
await channel.connect()
It has no errors - it is just doing nothing...
channel: discord.VoiceChannel
, not an assignment=
– Joshua Nixon