dook bot
- 13 Devlogs
- 16 Total hours
Youtube music downloading focused discord bot with other random features.
Youtube music downloading focused discord bot with other random features.
Prepared for shipping.
I figured working on this project got kind of repetitive and boring especially since I have significantly more fun projects coming up, so I decided to wrap this bot up.
I got rid of commented out unused code, and hid my api keys.
I also optimized some things, such as removing unnecessary logic. More importantly, I accidentally fixed an uncommon error that has randomly crashed the bot before, which somehow never got caught in my catch loops. This was because there was logic in the catch handler that caused it to crash again.
Anyway I’ll probably ship soon, enjoy
Failed to add some commands, instead added some weird doxxing features
I’ve been dead for a bit as I was sick and also working on another more fun project, but I threw together a openstreetmap geolocating feature, along with a command that gets ssids based on an inputted latitude and longitude, courtesy of WiGle. A major issue was that there were extremely low rate limits (like in the ones digits every day), so I basically could only test it like a couple times every day.
Previously the play command couldn’t accept links, only search queries.
Now it can!!
I made it hard for myself because my code was spaghettified and I had to use some hacky methods to get around it.
I did some miscellaneous code optimizing, such as converting a bunch of stuff to using the ytdlp-nodejs library.
Fixed a bug where it would play the wrong person’s playlist,.
I initially blamed the new feature to disable but it, turned out that I forgot to reset the queue upon running the playlist command.
I made the playlist shuffle feature optional.
I also added a secret unrelated command..
I updated the playlist command to fix certain limitations.
Previously, I’ve been using youtube’s api.
Did I mention it sucks? It has an annoyingly low limit per day, along with providing limited information.
Anyway I hit my daily limit and decided to fix it.
I refactored the playlist command by switching to ytdlp-nodejs, which essentially does everything in much cleaner ways.
Added a set playlist command.
This allows users to attach a youtube playlist url/id to themselves, so that the /playlist command can play an individual’s playlist. There is also the ability to play someone else’s playlist as long as they set one. I spent most of the time implementing a db.
Fixed the playlist command, added an embed to show current song, and added a skip command
All i had to do was wait for a yt-dlp update. In other words, my code fixed itself. Very fun
Added half of a playlist command, which lets the user play a shuffled verision of someone’s youtube playlist.
It was quite annoying since google’s documentation still sucks imo.
Consequences of that include situations like me wasting half an hour because the docs told me to use id when the actual thing was supposed to be playlistId.
I also had issues with yt-dlp being partially outdated., causing 403s upon downloading videos. Guess I’ll just have to wait a little bit.
Added the music player command to the bot.
It first downloads the video using yt-dlp and and then broadcasts it to a voice channel. I basically moved the search code from the previous devlog for this.
I did have some issues getting it to play music for the first time, since discord has some niche annoying feature that requires you to set the bot’s intents and i forgot to do that. Eventually, I got it working.
It came with some bugs related to file formatting, but they got fixed, and the bot should be working.
Added a feature to search for youtube videos.
Was a quick and easy api call, but Google’s documentation kinda sucks. I thought it was just me, but apparently internet people seem to agree. To quote one blog author, “Why has the YouTube API have to suck dongs?”
Anyway Google also gives you essentially no search calls a day (100/day), so to bypass that I grabbed a bunch of alts and spun up 5 or more keys which seemed like an appropriate and reasonable amount.
I created and setup the bot.
Following the discordjs guide, I made a command handler and a very bare bone slash command.