1
0
Fork 0
A discord bot made for the LP community discord server
Find a file
2022-12-22 00:07:48 +09:00
.github/img repo migration 2022-12-22 00:07:48 +09:00
.vscode repo migration 2022-12-22 00:07:48 +09:00
src repo migration 2022-12-22 00:07:48 +09:00
.eslintignore repo migration 2022-12-22 00:07:48 +09:00
.eslintrc repo migration 2022-12-22 00:07:48 +09:00
.gitignore repo migration 2022-12-22 00:07:48 +09:00
.prettierrc repo migration 2022-12-22 00:07:48 +09:00
CONTRIBUTING.md repo migration 2022-12-22 00:07:48 +09:00
jest.config.js repo migration 2022-12-22 00:07:48 +09:00
LICENSE repo migration 2022-12-22 00:07:48 +09:00
package.json repo migration 2022-12-22 00:07:48 +09:00
README.md repo migration 2022-12-22 00:07:48 +09:00
tsconfig.json repo migration 2022-12-22 00:07:48 +09:00
yarn.lock repo migration 2022-12-22 00:07:48 +09:00

Llama bot

example image of bot usage

The Llama bot is a discord bot made for the LP community discord server.

Setting up

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.
  2. Go to the Bot tab and convert your application to a discord bot. Be cautious since this operation is NOT REVERSIBLE.
  3. Copy the bot token. This will be used during the Server setup.

Firebase

  1. Head over to https://console.firebase.google.com and create a firebase project.
  2. Enable firestore database.
  3. Generate and download the service account key. This will be used during the Server setup.

Server

  • Assumes UNIX-like environment (Linux, BSD, Mac, etc.)
  1. Clone this repository and open 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.

    TOKEN=PUT_YOUR_DISCORD_BOT_TOKEN_HERE
    TESTING=true # set it to false on production
    PREFIX_PROD=PUT_PRODUCTION_DEFAULT_PREFIX_HERE
    PREFIX_DEV=PUT_DEVELOPMENT_DEFAULT_PREFIX_HERE
    OWNER_IDS=ID1,ID2,ID3,...
    
  4. Create secret directory in the src directory, rename the firebase admin key generated during the Firebase setup to firebase-adminsdk.json, and put it in the secret directory.

  5. Build the bot.

    yarn build
    
  6. Install pm2 globally.

    yarn global add pm2
    
  7. Start the bot.

    pm2 start build/index.js --watch --name "Llama Bot"
    
    Option Explanation
    --watch Auto restart bot if bot files have been changed
    --name "Llama Bot" Set the name of the process so it can be easily recognized
  8. Make the process automatically start on boot.

    pm2 startup
    

More info

Special thanks

  • Dabidoo#9888 (265697563280146433) for making the colored logo
  • Sɪʟᴋ Sᴘɪᴅᴇʀ#8364 (419184817368858644) for making the white logo