CxBot is a Discord bot that allows me to automate and improve many aspects of Discord.
-
Install dependencies with
npm i
-
Fill out a new file called .env with the template in .env.schema
-
Run
tsc
and compile the project -
If the compilation succeeded, proceed to run the bot by doing
node dist &
-
If you want to work with trello integration, you will need a postgres database. Use prisma to generate the tables and such. To do that,
-
Set the database url in the
.env
file. It should look something like:DATABASE_URL="postgres://{user}:{password}@{location[localhost]}:{port}/{dbname}&schema={schema type [probably public]}"
-
After, run
npx prisma migrate dev --name init
-
Now, to get the client run
npm install @prisma/client
-
If you plan on changing the database, you will need to migrate the structure with
npm install @prisma/client
-
./src/ Root directory.
|-bot/ Sapphire specific directory.
| |-arguments/ Custom arguments for commands.
| |-commands/ Commands.
| |-listeners/ Event listeners.
| |-preconditions/ Preconditions for commands.
| |-tasks/ Tasks running on cron intrevals.
|-lib/ Util and backend logic.
| |-extensions/ Classes that extend library classes.
| |-Task/ Task's piece and store.
| |-utils/ General utility functions.
|-prisma/ Prisma & database specific files.
|-typings/ Custom typescript types.