Inspiration
We wanted to be able to play music that we purchased and saved on our computers so our friends would be able to listen along on Discord.
What it does
The bot plays local files from your music folder in the voice channel of the user issuing the command. Our bot currently allows users to play, pause, resume, and stop songs. Users can play MP3 files from their local music folder.
How we built it
We used the Discord.py API to create the discord bot using Python to implement commands and events. We used FFmpeg for our discord bot to play audio files. We also utilized the PyNaCl library for the discord bot to join voice channels and discord.ext.commands, a bot commands framework.
Challenges we ran into
We had two main significant challenges. The first was the ability for the discord bot to play audio via FFmpeg. We used Discord.Voice_Client.play() to play an MP3 file but it was a huge challenge to get the FFmpeg executable file linked. The other challenge was trying to implement a song queue with a doubly-linked list using deque(). We tried many approaches to create a working song queue but got stuck when a user would add a song to the queue while a song was playing.
Accomplishments that we're proud of
We're proud that we implemented basic features of a music discord bot using an API and a programming language that we had no experience with.
What we learned
We learned basic Python syntax, some Python libraries, how to use PyCharm and do collaborative editing and debugging, as well as how to use the Discord API and their bot commands framework. We learned a basic understanding of async await as well as the challenges with learning to program asynchronously.
What's next for Local Music Bot
Future features for the Local Music Bot include a song queue that incorporates looping as well as skipping and rewinding. We also want to be able to play audio files from more than just the default Music directory.
Log in or sign up for Devpost to join the conversation.