Skip to content

kevmok/discordjs-typescript-template

Repository files navigation

Discord.js v14 Bot Template

Features

  • 🟦 Typescript
  • 💧 Drizzle ORM
  • ✔️ Zod Validation
  • 🔥 Slash commands (supports auto complete!)
  • ✉️ Message commands
  • 🕛 Cooldowns
  • 🏴 Detailed Permissions
  • 💪 Event & Command handlers
  • 🐶 Husky hooks

Installation, Build and Run

  1. Clone the repository then create a file named .env and fill it out accordingly (see .env.example)
TOKEN=BOT TOKEN
CLIENT_ID=BOTS CLIENT ID
PREFIX=.
DATABASE_URL=YOUR DB CONNECTION STRING
  1. Install the packages and dependencies by running the following command:
$ pnpm install
  1. Compile your TypeScript code to JavaScript by running the following command:
$ pnpm run build
  1. Once the build is complete it will generated a folder named dist that contains compiled version of your ts code to js. You can run the following command in your terminal to run the project:
$ pnpm run start

Run in development mode

To run in development mode, you can run the following command in your terminal:

$ pnpm run dev

Drizzle

  1. Create your schemas in src/db/schemas see Drizzle Docs for more info.
  2. Generate your migrations based on your schemas by running the following command:
$ pnpm run db:generate
  1. Push your schema changes directly to the database by running the following command:
$ pnpm run db:push
  1. (Optional) Run Drizzle Kit studio to manage your database by running the following command(see Drizzle Kit Studio Docs for more info.):
$ pnpm run db:studio

Acknowledgments 🔥

Big Props to MericcaN41 for the discord.js v14 template that I used as a base for this template.

License

This project is licensed under the MIT License. License: MIT

About

A discordjs typescript bot that leverages drizzle and zod

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published