Skip to content

Marco? Polo! A Discord bot for creating automated responses (aka macros / custom commands)

License

Notifications You must be signed in to change notification settings

BrackeysBot/Marco

Repository files navigation

Marco

Marco? Polo! A Discord bot for creating automated responses (aka macros / custom commands).

GitHub Workflow Status GitHub Issues MIT License

About

Marco is a Discord bot which can respond to macros in a Discord server, allowing you to define macros for specific channels or in all channels.

Installing and configuring Marco

Marco runs in a Docker container, and there is a docker-compose.yaml file which simplifies this process.

Clone the repository

To start off, clone the repository into your desired directory:

git clone https://github.com/BrackeysBot/Marco.git

Step into the Marco directory using cd Marco, and continue with the steps below.

Setting things up

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": {
    "cooldown": /* The cooldown, in milliseconds, between duplicate macro usages. Defaults to 5000 */,
    "prefix": /* The macro prefix. Defaults to [] */,
    "reactions": {
      "successReaction": /* The reaction the bot will give when a known macro is used. Defaults to ✅ (:white_check_mark:) */,
      "unknownReaction": /* The reaction the bot will give when an unknown macro is used. Defaults to null. */,
      "cooldownReaction": /* The reaction the bot will give when the same macro is used in quick succession. ⏳ (:hourglass_flowing_sand:) */
    }
  }
}

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 macro database.

Launch Marco

To launch Marco, simply run the following commands:

sudo docker-compose build
sudo docker-compose up --detach

Updating Marco

To update Marco, 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

Using Marco

For further usage breakdown and explanation of commands, see USAGE.md.

License

This bot is under the MIT License.

Disclaimer

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.