A containerised Discord bot written in Node.js, primarily for recording, searching and retrieving notes and quotes from a database. This project currently uses MariaDB as a backing store.
BOT_DISCORD_KEY=<YOUR_DISCORD_TOKEN>
BOT_DB_LOCAL_PORT=3306
BOT_DB_SERVER=corporallancot.db
BOT_DB_MOUNT_PATH=<DATABASE_MOUNT_PATH>
BOT_DB_SQL_SCRIPTS_MOUNT_PATH=<SCRIPTS_MOUNT_PATH>
MYSQL_ROOT_PASSWORD=<YOUR_ROOT_PW>
MYSQL_USER=notes
MYSQL_PASSWORD=<NOTES_USER_PW>
MYSQL_DATABASE=notes
<YOUR_DISCORD_TOKEN>
is the token for your discord bot.<DATABASE_MOUNT_PATH>
is the host machine path where the database files will be persisted. On a Windows host you can use something like d:/docker-mounts/corporallancot.db
, on a Linux host /docker-mounts/corporallancot.db
.<SCRIPTS_MOUNT_PATH>
is the host machine path where any SQL scripts that need to be executed after the container is created are located. See Initializing a fresh instance on this page for more information. This is useful for running ETL and / or custom setup scripts for the database. This can be an empty directory and follows the same rules as <DATABASE_MOUNT_PATH>
. The .gitignore file for this project implies that custom database setup scripts should be kept in the .sql
directory in the root; on Windows the mount path would be something similar to D:/Git/Personal/corporallancot/.sql
.<YOUR_ROOT_PW>
is the database's root password. This is for administrative purposes only. The root user is not used by the application.<NOTES_USER_PW>
is the database's notes
user password. This is the account that the application uses to connect to the database.docker-compose up -d
https://discord.com/api/oauth2/authorize?client_id=<YOUR_CLIENT_ID>&scope=bot&permissions=183296
<YOUR_CLIENT_ID>
is the ID of the Discord applicationDo not push sensitive information to the repo in config.json
!notes <message>
to log a message!quote
to retrieve a random message from the notes archive!quote <search term>
to retrieve a message using a basic search!help
to show a help message