botBob is an advanced Discord bot built with the latest Discord.js version (v14)! It includes modular commands, AI integration and unique functionalities, like timeout voting and debt tracking. botBob was designed from the ground up to be fully customizable, enabling the user to edit every command, every string, and every value through the configs. The bot is built primarily for our private Discord server, but feel free to use it if any of the features sound useful to you!
- Vote Timeout
- Debt Tracking
- Weather News Summaries and Warnings
- Custom User Responses
- Respond to Specific Words
- Rare Messages
- AI integration using OpenAI and Rapid API
- Fully Customizable Commands
- Multilingual Support
-
Go to https://discord.com/developers/applications and create a new application
-
Select the
Bot
tab and enableSERVER MEMBERS INTENT
andMESSAGE CONTENT INTENT
-
Navigate to
OAuth2 -> URL Generator
. UnderSCOPES
enablebot
and underBOT PERMISSIONS
enableAdministrator
-
On the bottom of the
URL Generator
page you should see an invite link. Copy & paste it in your browser's search bar and invite the bot to your server
-
Clone the Repository:
git clone https://github.com/Wilzzu/botBob.git cd botBob
or download the latest version.
-
Install Dependencies:
npm install
-
Configuration:
- Rename the
example.env
file to.env
and fill in the environment variables. - Rename the database files found in
/databases
folder from[name].example.json
to[name].json
. - Rename the config files found in
/configs
folder from[name].example.json
to[name].json
. Follow the instructions in Optional configuration if you want to make any changes.
- Rename the
-
Deploy commands and run the bot:
npm run commands npm run start
-
Either install the latest stable version:
docker pull wilzzu/botbob
or customize it first and build using:
docker build --tag botbob .
-
Start the bot using
docker run
with your environment variables:docker run -d wilzzu/botbob \ -e DISCORD_TOKEN=<YOUR_BOT_TOKEN> \ -e DISCORD_CLIENT_ID=<YOUR_CLIENT_ID> \ -e RAPID_API_KEY=<YOUR_RAPID_API_KEY> \ -e MONGO_URI=<YOUR_MONGO_URI>
or use
--env-file
to point to the path you stored your.env
file. You can find more info here.
View the Docker image on Docker Hub.
Name | Required | Description |
---|---|---|
DISCORD_TOKEN |
true |
Log into the bot |
You can find the bot's token under the Bot
tab in the Discord Developer Portal. Click on Reset Token
to generate a new token.
Name | Required | Description |
---|---|---|
DISCORD_CLIENT_ID |
true |
Deploy slash commands |
You can find the bot's Client ID under the OAuth2 -> General
tab in the Discord Developer Portal.
Name | Required | Description |
---|---|---|
OPENAI_API_KEY |
false |
Weather news AI integration |
OpenAI is used for generating summaries of weather news articles. You can find the API key under the API Keys
tab in the OpenAI Dashboard.
Name | Required | Description |
---|---|---|
RAPID_API_KEY |
false |
Timeout message AI integration |
OPEN AI by InfinitiSync API is used for generating AI timeout messages. You can try using other AI API's found on Rapid API, but they are not guaranteed to work with the bot. To get the API key, subscribe to the API and copy the X-RapidAPI-Key
.
Name | Required | Description |
---|---|---|
OPEN_WEATHER_API_KEY |
false |
Weather data for weather warnings |
OpenWeather API is used to get weather data for weather warnings. You can get the API key by signing up and navigating to the My API keys section.
Name | Required | Description |
---|---|---|
MONGO_URI |
false |
Timeout database |
To keep track of how many times a user has been timed out, you will need to create a new database in MongoDB. Here's a tutorial to get you started. Once created, click on Connect -> MongoDB for VS Code
and copy the URI. Lastly replace the <password>
part with your password.
You can fully customize every aspect of botBob by modifying the config files found in /configs
folder. If you are using Docker to run the bot, edit the [name].example.json
files, otherwise first rename those files to [name].json
and then edit them.
-
config.json
file contains all the options, such as:- Selected language and prefix
- Guild and channel ID's
- Admin ID's
- Timeout lengths and vote durations
- Custom responses and rare messages
- OpenAI and Rapid API configurations
-
languages.json
file contains every string the bot uses and their translations:- Languages
- Command names and descriptions
- Activities
- AI Prompts
- Error messages
- To enable MongoDB, set the
useMongoDB
field totrue
inconfig.json
. - To enable OpenAI weather news AI integration, set the
enableNews
field totrue
. - To enable Rapid API timeout response AI integration, set the
aiResponses
field totrue
.
Important
When enabling these features, make sure their environment variables are set in the .env
file or are passed to docker run
.
Create your own translations by copying a pre-existing language object in languages.json
file, renaming it and changing the strings to suit your preferences. Then change the selected language in config.json
file to your newly created one and run npm run commands
or rebuild if using Docker.
Command | Options | Description |
---|---|---|
/setup |
null |
Setup channels |
/timeout |
@user |
Vote a user to be timed out |
/debt |
@from @to <amount> |
Add debt to a user |
/admin |
@user |
Give admin permissions to a user |
You can disable unneeded commands by deleting their command files at /commands/utility/[command].js
and running npm run commands
, or rebuilding if using Docker.
I've been developing botBob since 2019, and over the years, several features were implemented that have since been deprecated. You can find the code for these features under the /deprecated
folder. I've included them to be transparent and show how the code quality and design have evolved over the course of this project.
Feel free to check out these details and screenshots showing how the features used to look when they were still in use:
Show Details & Screenshots
2023 was extraordinary hot year, so I made a script that would send all the news articles that had anything to do with the weather. I scraped the info from one news site and the other had a dedicated API. The script ran until summer was over.
This was different from the current new weather news feature, which uses OpenAI to generate summaries of the articles.
Users could share their food pictures with each other on the server. Each submission would show up on a website which had a map of all the posts. Other users could like and comment on the post and check all the other posts on the map.
Submitting a food post was done via a slash command, which made the bot send the user a direct message with instructions:
-
First the user had to select their coordinates, which was done via the same website. The user could move a pin on the map and select where they were at, or user their phone's GPS to select it automatically for them.
-
Then they had to send the coordinates to the bot, which would show a confirmation message of the selected location. Finally the user had to send a picture of their food, give it a rating and confirm the post.
-
After submitting a post, it would show up on the main server. Other users could then like, comment and check out the post on the map website.
One of our users went to the compulsory military service here in Finland. It is a tradition to count how many days are left of your service, and each day would represent a Pokémon. I also added other stats:
- Today's weather at his service location
- Money made during the service
- His and his peers' swimming achievements
- Pokémon and Digimon
The bot would then send a message with these stats everyday at 6 AM until his service was over.
(botBob is not affiliated with the creators of Pokémon or Digimon. All the trademarks are property of their respective owners.)
Our Discord server got into CS:GO during the COVID-19 outbreak, so I built a bot that would send an alert when a new professional match was starting. It would list all the important stats of the match, and update the selected maps in real time when the teams were selecting them. The main livestream and a Finnish livestream were linked below the alert, as well as the HLTV match page.
This project is licensed under the MIT license.