WidenBot is a simple, self-hosted (by you!) music bot for Discord.
Inspired by past and present titans such as Groovy, Rythm, ProBot, etc. But this time: no unnecessary features, misbehavior, or monetization.
The purpose of this project is to serve as:
- A reliable, personal jukebox for you and your Discord server(s)
- A simple reference implementation of a Discord bot built with .NET and hosted via Docker
Due to the nature of what a music bot is trying to accomplish, it can be prone to breakage which is often outside of WidenBot's direct control. In any case, please feel free to reach out directly or open an issue if you run into trouble.
Hosting a WidenBot requires Python 3 and Docker. See Docker install for instructions on installing Docker.
-
Go to the Discord Developer Portal, login as the Discord account that should own the bot, and create a new application
-
Within the Bot settings:
- Disable "Public Bot" (optional)
- Enable "Server Members Intent" and "Message Content Intent"
- Click the "Reset Token" button and save the resulting token for later
-
Within the OAuth settings:
- Add a redirect for
https://discord.com
(Under "General" sub-category) - Generate an invite URL with the
application.commands
andbot
scopes, and the following permissions:- Read Messages/View Channels
- Send Messages
- Manage Messages
- Use Slash Commands
- Connect
- Speak
- Add a redirect for
-
Use the generated URL to invite the bot to a server of your choice
-
Go to the Spotify developer dashboard and sign in with whatever Spotify account you want to use
-
Create a new Spotify app for OAuth purposes (Development mode and other defaults should be sufficient), and save the client ID and secret for later
-
Clone this repository, and copy the contents of
config.template.json
into a new file calledconfig.json
-
For each instance of WidenBot you want to run, add an object to the array in your new
config.json
like so:{ "label": "An arbitrary label for this instance of WidenBot", "isEnabled": true, "useSponsorBlock": true, "discord": { "serverID": "Right-click on server in Discord and select 'Copy Server ID'", "botToken": "Bot token from Discord Developer Portal", "requiredChannel": "Right-click on channel and select 'Copy Channel ID' to restrict channel usage, set to null if you want to handle via server roles instead" }, "spotify": { "clientID": "Client ID from Spotify developer dashboard", "clientSecret": "Client secret from Spotify developer dashboard" } }
-
If on a Linux host, ensure the
src/plugins
directory has sufficient permissions. -
From the root of the repository, execute:
python3 run.py start
The bot can be hosted from any machine that can install Docker and Python 3. If you need a hosting platform, DigitalOcean makes it easy to set up a server, feel free to use the referral badge below which apparently provides a credit: