A self-hosted, modular Discord bot that adds more life to a Discord server
AGPL-3.0 License
BoneBot is a self-hosted, modular Discord bot that can respond and react to messages, add custom commands, send random files and quotes, and generate memes on demand to add more life to a Discord server.
BoneBot was originally written as a meme-generating Discord bot for the ISUCF'V'MB Trombone and Bass Trombone Discord server. The bot also has functionality to respond and react to messages and commands. This is utilized as a way to add helpful commands to the server to show links for online folders and band information.
The meme generator will generate a meme with top and bottom text in Impact font.
bbmeme
bbmeme <image> <top text> \n <bottom text>
(Can also press shift+enter instead of \n
)If you make a mistake in typing the command, or wish to generate another meme with similar inputs, you can edit the message to fix it without needing to send another message.
The file module will send a random file from resources/files
. This can be an image, video, text file, audio file, etc.
A specific file can also be sent from the resources/files
folder
bbfile
bbfile <path>
resources/files
The quote module will send a random quote from a file.
bbquote
The responder will respond to a message with another when a trigger phrase is sent in a message or an edit. It can appear like it is typing the message itself!
The reactor will react to a message with an emote when a trigger phrase is sent in a message or an edit.
BoneBot allows for custom commands to be made to provide text and image responses and run shell commands. Their usage is
pretty simple - a command called test
would be used by typing bbtest
. If you make a mistake in typing a command, you
can edit the message to fix it without needing to send another message. This module can provide simple ping-pong style
commands, or more complex commands as needed. Some fantastic examples of custom commands can be
found here.
BoneBot can have various randomized statuses shown in Discord that change over time.
The welcomer will send a private message to new users who join to welcome them to the server. This can be used to show server rules and an explanation of how to get started.
Any version of Windows, macOS, or Linux that can run Java 11 or later.
./gradlew shadowJar
in the directory of the project./build/libs/BoneBot.jar
should have been generated.You can also grab BoneBot.jar
from the latest releases.
Place BoneBot.jar
where you would like it to be installed.
BoneBot.jar
where you would like it to be installed.bonebot.service
file in /etc/systemd/system/
, making sure to change the WorkingDirectory
ExecStart
, as well as the User
:[Unit]
Description=Service to start BoneBot
After=network-online.target
[Service]
WorkingDirectory=/path/to/BoneBot-folder
ExecStart=/usr/bin/java -jar /path/to/BoneBot.jar
User=set_user_here
Restart=always
[Install]
WantedBy=multi-user.target
Dockerfile
wherever you would like:FROM ubuntu:20.04 as runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install default-jre-headless wget locales -y
WORKDIR /app
RUN wget https://github.com/jeremynoesen/BoneBot/releases/download/1.7.2/BoneBot.jar
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENTRYPOINT ["java", "-jar", "BoneBot.jar"]
docker-compose.yml
wherever you would like, making sure to change the context
to the path ofDockerfile
, and volumes
to wherever you would like the volume to be stored:version: '3'
services:
bonebot:
container_name: bonebot
build:
context: /path/to/dir/containing/Dockerfile/
restart: unless-stopped
network_mode: host
volumes:
- /path/to/volume:/app/resources
You must create a Discord Application before you continue. This creates the bot user that will be used to run the bot.
CLIENT_ID
with the application ID from the "General Information"All methods of running for the first time will generate all necessary configuration files and folders, but will fail to
start the bot. You will need to set bot-token
in resources/config.txt
to the token you copied earlier for the bot to
start.
Run cd /path/to/BoneBot-folder && java -jar BoneBot.jar
to start the bot.
Run sudo systemctl enable bonebot && sudo systemctl start bonebot
to start the service and allow it to start on boot.
Run docker compose up -d
in the directory of docker-compose.yml
to start the container.
After changing any of text configurations, save the file and restart the bot.
Use these placeholders in most configurations. Places they are disallowed will be specified per module. Module-specific placeholders will also be specified per module.
$AUTHORMENTION$
- Place a mention of the author in the message.$AUTHORDISPLAYNAME$
- Place the author's display name in the message.$AUTHORUSERNAME$
- Place the author's username in the message.$BOTMENTION$
- Place a mention of the bot in the message.$BOTDISPLAYNAME$
- Place the bot's display name in the message.$BOTUSERNAME$
- Place the bot's username in the message.$CHANNELMENTION$
- Place a mention of the channel in the message.$CHANNELNAME$
- Place the channel's name in the message.$GUILD$
- Place the guild's name in the message.$REPLY$
- Send the message as a reply to the author.\n
- Place a new line character in the message.resources/memeimages
folder. They must be PNG or JPG format.resources/memetexts.txt
.
<top text> \n <bottom text>
.$REPLY$
.memes-size
in the main configuration to any number. This limits the larger0
to use the image's originalmemes-font-scale
in the main configuration. It defaults to 1.0
.memes-cooldown
in the main configuration to any whole number in seconds.memes-enabled
in the main configuration to true
or false
.resources/quotes.txt
.$REPLY$
.quotes-cooldown
in the main configuration to any while number in seconds.quotes-enabled
in the main configuration to true
or false
.resources/files
.files-cooldown
in the main configuration to any whole number in seconds.files-enabled
in the main configuration to true
or false
.resources/responses.txt
.trigger: response
. $&&$ response
to add a multi-message response. $||$ response
to have multiple messages to randomly choose from for a response.$REPLY$
.$FILE$ path/to/file $FILE$
.responder-typing-speed
in the mainresponder-delay
in the mainresponder-cooldown
in the main configuration to whole any number inresponder-enabled
in the main configuration to true
or false
.resources/reactions.txt
.trigger: emote
. $&&$ emote
to add a multi-emote reaction. $||$ emote
to have multiple emotes to randomly choose from for a reaction.$REPLY$
.U+1F980
, or a raw discord emote, :bonebot:819645061200347177
.reactor-delay
in the main configurationreactor-cooldown
in the main configuration to any whole number in seconds.reactor-enabled
in the main configuration to true
or false
.resources/commands.txt
.command: description: response
. $&&$ response
to add a multi-message response. $||$ response
to have multiple messages to randomly choose from for a response.$REPLY$
$FILE$ path/to/file $FILE$
.$REACT$ emote $REACT$
. Format for emotes is similar$EMBED$ embed title here $EMBED$
.
$CMD$ command here $CMD$
.
$CMDOUT$
to your response to also include the output of this command in the response.$FILE$
to send that file.$CMD$
blocks. These can be used${VARIABLE}
in Linux and macOS, or %VARIABLE%
in Windows. To view what variables are available andmodules/commands/Commands.kt
. There are too many variables, socommands-prefix
in the main configuration to a custom prefix. Case is ignored.commands-cooldown
in the main configuration to any whole number in seconds.commands-enabled
in the main configuration to true
or false
. This willresources/statuses.txt
.playing
, watching
, or listening to
.$BOTDISPLAYNAME$
.statuses-delay
to set how long each status shows in seconds as a whole number.statuses-enabled
in the main configuration to true
or false
.resources/messages.txt
under welcome-message
.$REPLY$
, $CHANNELMENTION$
, and $CHANNELNAME$
.$FILE$ path/to/file $FILE$
.welcomer-enabled
in the main configuration to true
or false
.resources/messages.txt
.$AUTHORMENTION$
, $BOTMENTION$
, $CHANNELMENTION$
, and $REPLY$
can not be used for embed titles.help-about
message can include a file foe the embed using the $FILE$
format.embed-color
in the mainlisten-to-bots
to true
. It defaultsfalse
.max-threads
to any integer. 0 or lower removes the limit.Located at resources/config.txt
responder-enabled: true
responder-cooldown: 180
responder-delay: 1000
responder-typing-speed: 100
reactor-enabled: true
reactor-cooldown: 60
reactor-delay: 1000
memes-enabled: true
memes-cooldown: 5
memes-size: 1200
memes-font-scale: 1.0
statuses-enabled: true
statuses-delay: 60
commands-enabled: true
commands-cooldown: 5
commands-prefix: bb
quotes-enabled: true
quotes-cooldown: 5
files-enabled: true
files-cooldown: 5
welcomer-enabled: true
listen-to-bots: false
max-threads: 8
embed-color: #fd0605
bot-token: TOKEN
Located at resources/messages.txt
help-title: $BOTDISPLAYNAME$ Help
help-about: $BOTDISPLAYNAME$ aims to add more life to a server by responding and reacting to messages. It also adds commands, which are listed below.
help-format: • **`$CMD$`**: $DESC$
help-description: Show this help message.
meme-description: Generate a random or custom meme.
file-description: Send a random or specific file.
quote-description: Send a random quote.
help-command: help
meme-command: meme
file-command: file
quote-command: quote
meme-title: $AUTHORDISPLAYNAME$ generated a meme:
welcome-title: $AUTHORDISPLAYNAME$ joined $GUILD$
quote-title: "$AUTHORDISPLAYNAME$ summoned a quote:"
file-title: "$AUTHORDISPLAYNAME$ summoned a file:"
welcome-message: "Welcome $AUTHORMENTION$ to **$GUILD$**!"
error: **An error occurred!** Please check the console!
unknown-command: **Unknown command!**
no-files: There are **no files** to send!
unknown-file: **Unknown file!**
meme-input-missing: Please provide the missing **text** and/or **image**!
no-quotes: There are no quotes to show!
meme-cooldown: Another meme can be generated in **$TIME$** seconds.
file-cooldown: Another file can be sent in **$TIME$** seconds.
quote-cooldown: Another quote can be sent in **$TIME$** seconds.
command-cooldown: Commands can be used again in **$TIME$** seconds.
Below are a few images showing what BoneBot can do. Simple actions, such as reactions, text responses, and status messages, are not shown due to those being basic Discord functions.
The following image is an example of the meme generator using a user's avatar, as well as top and bottom texts:
The following image is an example of the help command, with some built-in commands disabled and some custom commands added: