A simple, unintrusive musicbot written in Discord.py that utilizes YoutubeDL and ffmpeg to stream audio. Use the help
command to get a list of commands!
If you just want to get up and running with the bot quickly:
- Clone this repository using the GitHub website or GitHub/git CLI.
- Install
pipenv
, the Python dependency manager, if necessary. Also, ensureopus
andffmpeg
are installed on your machine and available in your environment. Both are used for media streaming. - Navigate into the project directory and run
pipenv install
to install dependencies. - Activate the Pipenv using
pipenv shell
. Run the bot usingpython -m musicbot
. - On first startup, a default
config.toml
will be generated without an API token, so the bot will abort complaining thatNo token has been provided.
Fill your bot's token intoconfig.toml
. - Use something like the Discord API Permissions calculator to generate an invite link and invite your bot to your server, if necessary.
- Run the bot using
python -m musicbot
.
Make sure that pipenv is installed. Navigate to the project directory, and run pipenv install
to install the Python dependencies.
To allow for streaming of media, make sure opus
and ffmpeg
are installed and in your environment.
To run the bot, activate the virtual environment with pipenv shell
and then python -m musicbot
to start the bot.
When you run the bot for the first time, a default configuration file will be generated called config.toml
. You can enter that file and add your token, etc. The default file looks like this:
"token"="" # the bot's token
"prefix"="!" # prefix used to denote commands
[music]
# Options for the music commands
"max_volume"=250 # Max audio volume. Set to -1 for unlimited.
"vote_skip"=true # whether vote-skipping is enabled
"vote_skip_ratio"=0.5 # the minimum ratio of votes needed to skip a song
[tips]
"github_url"="https://github.com/joek13/py-music-bot"
If you ever wish to restore the bot to default configuration, you can simply delete (or rename) your config file. A new one will be generated upon startup.
From the bot's help
command:
Meta:
uptime Tells how long the bot has been running.
Music:
leave Leaves the voice channel, if currently in one.
play Plays audio from <url>.
Tips:
tip Get a random tip about using the bot.
No Category:
help Shows this message
Issues and pull requests are welcomed and appreciated. I can't guarantee that I will respond to all issues in a timely manner, but I will try my best to respond to any issues that arise.