Reputation: 1
I recently started making a Discord bot on Python, and I would like to create a music playing option, so I used the function "connect()" which require the library "PyNaCl", so I installed the library and I imported it on my Python program, but when I call the connect() function there is the following error :
Traceback (most recent call last):
File "C:\Users\Triplaqs\Documents\BOT DISCORD\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\Triplaqs\Documents\BOT DISCORD\Bot Discord.py", line 92, in on_message
await message.author.voice.channel.connect()
File "C:\Users\Triplaqs\Documents\BOT DISCORD\discord\abc.py", line 1277, in connect
voice = cls(client, self)
File "C:\Users\Triplaqs\Documents\BOT DISCORD\discord\voice_client.py", line 199, in __init__
raise RuntimeError("PyNaCl library needed in order to use voice")
RuntimeError: PyNaCl library needed in order to use voice
However I did import the nacl library. How can I use the connect() function ?
By the way this is my program music part :
if message.content.startswith("!play") or message.content.startswith("!p"):
if len(message.content.split())==1 :
await message.channel.send("no song given")
elif message.author.voice==None:
await message.channel.send("request user is not in a voice channel")
else:
VC=message.author.voice.channel
await message.author.voice.channel.connect()
Thanks for reading,
Triplaqs.
Upvotes: 0
Views: 314