OPUS SUPPORT FOR DISCORD MUSIC BOTS!
UPDATE: Repl.it has Native OPUS and Discord Music Bot support so you don't need to use this post anymore
The wait is over! You can now make music bots with discord! I have compiled
libopus.so for repl.it which you can now use to make music bots.
To make your bot in python, all you have to do is fork the repl linked below.
If you want to use a different language than python for your bot, you need to download the .so file. Just fork the repl, press ctrl+shift+s, type
php -S 0.0.0.0:8080, and then add
/libopus.so.0.8.0 to the url of your repl to download the file. Next, upload this file into your repl.
Ask questions in the comments, I might be able to help.
Before you comment asking for help:
Try it first, then let me know whether it worked or not. If it worked for you I'll update the post, otherwise I'll help the best I can.
Enjoy, upvote if it helped you!
Thanks so much, Scoder! I will close the bug report and direct people to this.
EDIT: we just fixed this for Node.js. Try it out.
@tpunn19 Awesome! I need help adding a node.js template to our template library -- do you have a simple node.js music bot repl we can add?
Hey pls help i am using NODE.JS. When i give the command to play it just doesnt do anything only when i do !play it connects, but when i do !play(url) nothing happens pls help me thanks !!
Well, it works. But sometimes it has a problem.
"RuntimeError: PyNaCl library needed in order to use voice"
It comes and goes for no reasons, Any idea?
Hello I have an error in my music bot that does not play the songs, I did it from my pc, I uploaded it and it does not play, but if I open it from visual studio code it plays, I wanted to see if someone can help me I am new to this world of programming
Still not working for me - The code hangs on
await message.author.voice.channel.connect() and never completes. The bot physically joins the channel but any attempt to disconnect or play audio, it just
Not connected to voice.
@Mckael123 well here's the official quick-start guide for general python bots:
discord.py package required
and here's the api reference for adding stuff etc:
(although stackoverflow might be more helpful ;) )
Since you want to do music, you need to look into ffmpeg.
Also you need to have the discord.py[voice] package installed to effectively connect to vc and play audio.
After that you're going to need to think about audio playlists etc.. This is relatively simplified if you use an array or dictionaries which store your next track, and recursive functions.
Hi, I'm actually doing this in nodejs and I'm getting the same as before the file was added (the bot joins the vc but doesn't play nothing). I'm using Discord.js 12.2.0 and ffmpeg-static.
I can't believe the Repl.it team gave up and didn't actually implement this themselves. Good work nonetheless.
Can we get more in depth instructions for nodejs installation
Have a virtual cookie! By the way, to start a local web server you can also do
python3 -m http.server 8080 (if you want to stay in the python ecosystem :p)