Skip to content
Public template

About

An advanced handler for typescript. Using as dependency. Discord.js

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

CommandHandlerTs

A TypeScript-first Discord command handler template focused on modular command/event architecture.

Status: legacy template targeting discord.js@13 and Node 14+.

Why this project

This repository provides a starter base for bots that need:

  • Prefix command handling
  • Slash command support baseline
  • Event-driven structure
  • Environment-based configuration

Project structure

src/
  Database/
  Events/
  Typings/
  config.ts
  index.ts
  main.ts

Requirements

  • Node.js >=14
  • npm or yarn
  • MongoDB instance (optional, if your bot uses DB features)

Quick start

  1. Install dependencies:
    npm install
  2. Create env file:
    cp .env.example .env
  3. Fill required variables in .env.
  4. Run the bot:
    npm run start

Scripts

  • npm run start → run with ts-node
  • npm run dev → auto-reload development mode
  • npm run typecheck → TypeScript validation (no emit)
  • npm run build → compile project
  • npm run check → typecheck + build (CI-equivalent local gate)

Environment variables

Variable Description
TOKEN Discord bot token
MONGO_URI MongoDB connection string

Quality and contribution

License

Apache-2.0

About

An advanced handler for typescript. Using as dependency. Discord.js

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages