Skip to main content

Setting up

Use the dev branch (javascript) instead of the master branch (python).

This page will teach you how to set up the llama discord bot.

Result:
example image of bot usage

Steps#

Pre-requirements#

  • Node.js 16.6.0+
  • yarn
  • A Discord account
  • A Google Firebase account
  • A sacrifice to be given to the llama gods (no longer needed)

Discord#

  1. Create a new application from the Discord Developer Portal. Select one if you already have it. Be cautious though, since this operation is NOT REVERSIBLE.
  2. Make application a bot.
  3. Copy the bot token. This will be used during the Server setup.

Firebase#

  1. Create a firebase project.

    https://console.firebase.google.com

  2. Create firestore database (production mode is highly recommended).

  3. Generate and download the service account key. This will be used during the Server setup.

Bot#

info

Assumes UNIX-like environment (Linux, BSD, Mac, etc.)

  1. Clone the llama bot repository and cd into it.

    git clone https://github.com/llama-bot/llama-bot.git
    cd llama-bot
  2. Install dependencies.

    yarn install
  3. Create .env file in the project root and put the discord bot token generated during the Discord setup.

    .env
    TOKEN=PUT_YOUR_DISCORD_BOT_TOKEN_HERE
  4. Create secret directory in the src directory, rename firebase admin key generated during the Firebase setup to firebase-adminsdk.json, and put it in the secret directory.

TODO: systemd and/or auto restart/reload pm2?

Testing#

After following all the steps, run the following command to start the bot:

yarn start

If everything is set up correctly, this should start the bot.

More info#