neverabsolute / BuilderBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BuilderBot

Setup

NOTE: This project is currently only supported on Linux or macOS. If you are on Windows you can use the Windows Subsystem for Linux to run this project.

There is a great video for setting up and using WSL here.

Creating a Discord bot

  • https://discord.dev
  • Enable all privileged intents
  • Copy the bot token to an environment variable called BUILDER_BOT_TOKEN

Database setup

  • Install PostgreSQL
  • Create a user called builderbot with the password builderbot, make it superuser
  • Create a database called builderbot owned by the user builderbot
  • Copy the file /packages/bot-prisma/.env.example to /packages/bot-prisma/.env

Installing NVM

Installing Node.js

nvm install 18
nvm use 18

Installing pnpm

npm install -g pnpm

Installing dependencies

pnpm i

Running the project

pnpm dev

Development

The bot looks for a couple things to run:

  • a GUILD_ID environment variable, this is what guild the bot looks in while running the various loops it has
  • a BUILDER_BOT_TOKEN environment variable, this is the token for the bot to use to connect to Discord
  • a TICKETBAN_ROLE_ID environment variable, this is the role id for the role that is banned from creating tickets
  • an AssociatesConfiguration entry, this just defines the category for the bot to watch and create start messages in, as well as the delay for retakes and the role id to give
  • an AssociatesQuiz entry, which is just what ties all the questions together
    • any number of AssociatesQuestions entries, which are just the questions with the question text
      • any number of AssociatesQuestionChoices entries, which are the choices for the question, they can me marked as correct or not

About


Languages

Language:TypeScript 98.1%Language:Dockerfile 1.2%Language:PLpgSQL 0.6%Language:Shell 0.1%