A Discord bot for rendering TeX expressions.
Pencil is a Discord bot which introduces commands to render TeX expressions and format code into codeblocks.
Pencil runs in a Docker container, and there is a docker-compose.yaml file which simplifies this process.
To start off, clone the repository into your desired directory:
git clone https://github.com/BrackeysBot/Pencil.git
Step into the Pencil directory using cd Pencil
, and continue with the steps below.
The bot's token is passed to the container using the DISCORD_TOKEN
environment variable. Create a file named .env
, and add the following line:
DISCORD_TOKEN=your_token_here
Two directories are required to exist for Docker compose to mount as container volumes, data
and logs
:
mkdir data
mkdir logs
Copy the example config.example.json
to data/config.json
, and assign the necessary config keys. Below is breakdown of the config.json layout:
{
"GUILD_ID": {
"filteredRegexes": /* An array of Regex pattern strings for filtered expressions */
}
}
The logs
directory is used to store logs in a format similar to that of a Minecraft server. latest.log
will contain the log for the current day and current execution. All past logs are archived.
The data
directory is used to store persistent state of the bot, such as config values and the infraction database.
To launch Pencil, simply run the following commands:
sudo docker-compose build
sudo docker-compose up --detach
To update Pencil, simply pull the latest changes from the repo and restart the container:
git pull
sudo docker-compose stop
sudo docker-compose build
sudo docker-compose up --detach
For further usage breakdown and explanation of commands, see USAGE.md.
Contributions are welcome! See CONTRIBUTING.md for details.
This bot is under the MIT License.
This bot is tailored for use within the Brackeys Discord server. While this bot is open source and you are free to use it in your own servers, you accept responsibility for any mishaps which may arise from the use of this software. Use at your own risk.