https://github.com/itsmaat/wd-40
A music, utility & fun discord bot made in JavaScript
https://github.com/itsmaat/wd-40
discord discord-bot discordjs discordplayer musicbot musicbotdiscord soundcloud spotify youtube
Last synced: 4 months ago
JSON representation
A music, utility & fun discord bot made in JavaScript
- Host: GitHub
- URL: https://github.com/itsmaat/wd-40
- Owner: iTsMaaT
- License: mit
- Created: 2022-11-07T03:22:37.000Z (almost 3 years ago)
- Default Branch: develop
- Last Pushed: 2025-05-31T15:48:27.000Z (4 months ago)
- Last Synced: 2025-06-11T16:43:22.639Z (4 months ago)
- Topics: discord, discord-bot, discordjs, discordplayer, musicbot, musicbotdiscord, soundcloud, spotify, youtube
- Language: JavaScript
- Homepage: https://discord.gg/pqKE2QZrFM
- Size: 8.99 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
WD-40 Discord Bot
## Table of Contents
- [Features](#features)
- [Adding to your server](#adding-to-your-server)
- [Self-hosting](#self-hosting)
- [Database](#database)
- [Help and support](#help-and-support)[![JavaScript][JavaScript-Badge]][JavaScript-Url]
# Features
- Music playback from multiple sources (Spotify, Deezer, Youtube, and more)
- Text manipulation commands
- Fun games (Blackjack, Hangman, etc.)
- Auto-reactions and auto-responses
- Reddit integration
- AI features with Gemini
- Moderation tools
- Customizable per server# Adding to your server
1. You can follow this [link](https://discord.com/oauth2/authorize?client_id=1036485458827415633) to add the bot to your server.
2. The base prefix for text commands will be `>`
3. You can execute the `/help` command (or `>help`) to get a list of all commands.
4. Profit! If any issues arise, feel free to join the [support server](https://discord.gg/pqKE2QZrFM) and ask for help.
5. Alternatively, you can execute the `/suggestion` command (or `>suggestion`) to suggest a feature or a bug fix.# Self-hosting
Good luck.
1. Add a bot app in the [Discord Developer Portal](https://discord.com/developers/applications) and get the token and client ID.
2. Make sure to enable all privileged intents in the bot app if you want full functionality.
3. Install [Node.js](https://nodejs.org/en/download/) v20.x LTS and latest version of [FFmpeg](https://ffmpeg.org/download.html).
4. Clone this repository and run `npm install` (use `npm install --legacy-peer-deps` if errors occur).
5. Configure `.env` file in the root directory with your bot token and client id (details in `.env.example`).| Variable | Description |
| - | - |
| | |
| Required | - |
| TOKEN | The bot token, which you can get from the [Discord Developer Portal](https://discord.com/developers/applications). |
| CLIENT_ID | The client ID of the bot, which you can get from the [Discord Developer Portal](https://discord.com/developers/applications). |
| SERVER | Either `prod` or `dev`, will make the bot only react to its owner on dev. |
| OWNER_ID | The ID of the owner of the bot. |
| | |
| Optional | - |
| DEV_TOKEN | The development bot token, which you can get from the [Discord Developer Portal](https://discord.com/developers/applications). |
| CONFIG_FILEPATH | Override the default config file path. You can use `@root` to refer to the root directory of the project. |
| GEMINI_API_KEY | The token for the Gemini AI API, which you can get from the [Gemini API](https://ai.google.dev/gemini-api/docs) website. |
| PTERODACTYL_API_KEY | If hosting on Pterodactyl, the API key for your panel. |
| PTERODACTYL_URL | The URL for your panel. |
| PTERODACTYL_SERVER_ID | The ID of the server on your panel. |
| VIRUS_TOTAL_API_KEY | The API key for the VirusTotal API, which you can get from the [VirusTotal](https://www.virustotal.com/) website. |
| STEAM_API_KEY | The API key for the Steam API, which you can get from the [Steam](https://steamcommunity.com/dev) website. |
| REDDIT_CLIENT_SECRET | The client secret for the Reddit API, which you can get from the [Reddit](https://www.reddit.com/prefs/apps) website. |
| REDDIT_CLIENT_ID | The client ID for the Reddit API, which you can get from the [Reddit](https://www.reddit.com/prefs/apps) website. |
| REDDIT_REFRESH_TOKEN | The refresh token for the Reddit API, which you can get from the [Reddit](https://www.reddit.com/prefs/apps) website. |
| YOUTUBE_COOKIE | A YouTube session cookie. It is recommended to get it from an alt account in an incognito tab. |
| DEEZER_MASTER_KEY | The master key for the Deezer API. |
| DEEZER_ARL_COOKIE | Your deezer cookie. |
| DATABASE_URL | The URL for the database, to create the DB, please refer to [DATABASE](#database) below. |
| SENTRY_DSN | Sentry DSN to enable Sentry logging of ERROR/SEVERE/WARNING |
| SPOTIFY_CLIENT_ID | Your Spotify's app client ID. |
| SPOTIFY_CLIENT_SECRET | You Spotify's app client secret. |
| - | - |
| STATUS_CHANNEL_ID | The ID of the channel where the bot will post status updates. |
| MEMBERS_UPDATE_ID | The ID of the channel where the bot will post member updates. |
| SUGGESTION_CHANNEL_ID | The ID of the channel where the bot will post suggestions from the `/suggestion` (`>suggestion`) command. |
| GUILD_UPDATE_ID | The ID of the channel where the bot will post guild updates. |
| GUILD_BLACKLIST | A comma-separated list of guild IDs that the bot should leave immediately upon joining. |
| GLOBAL_BLACKLIST | A comma-separated list of user IDs that are globally blacklisted from using the bot. |
| SUPERUSER_WHITELIST | A comma-separated list of user IDs that have superuser permissions. |> If Reddit client secret, ID, and token are not configured, it will use the normal API instead of going through OAUTH if not specified.
## Add your own music library
If you wish to add your own library, make a music folder in the root of the project and add your files there, they will be used for query and spotify search and will be given as the first choice in the 10 choices list.
You can also configure the file extensions in the config file.
4. Set up the database.
# Database
The bot uses a MySQL database to store data. You can create a database by running the following command:
> TODO (For more details : https://github.com/iTsMaaT/WD-40/tree/database-docs-and-sqlite)
## No Database Mode
As of version 5.8.0, you can run the bot without a database. Simply don't provide the `DATABASE_URL` in your `.env` file. Note that some features requiring persistence will be disabled in this mode.
# Help and support
If you need help, feel free to join the [support server](https://discord.gg/pqKE2QZrFM) and ask for help.
# Known issues
If you are hosting on a VPS and use Youtube for the music part, your IP might get blocked by YouTube as it systematically blocks IPs that are from a VPS, in this case, you can disable YouTube and use Deezer or SoundCloud instead by modifying the config in `utils/config/config.json`.
[JavaScript-Badge]: https://img.shields.io/badge/JavaScript-%23323330.svg?style=flat&logo=javascript&logoColor=%23F7DF1E
[JavaScript-Url]: https://en.wikipedia.org/wiki/JavaScript "JavaScript"