A π₯ TypeScript + discord.js template to kickstart your Discord bot project in no time! It includes MongoDB integration with Mongoose, command & event handlers, automatic slash command registration, and utility functions.
- β‘οΈ Fast setup with TypeScript
- π₯ Automatic slash command registration (
registerCommands.ts
) - π Robust event & command handlers
- ποΈ MongoDB integration via Mongoose
- β±οΈ Cooldown mechanism for commands
- πΌοΈ Dynamic image generation using
node-html-to-image
- Node.js v18 or higher
- Bun (optional) or Nodemon
- MongoDB connection URI
- Discord Bot Token
git clone https://github.com/<username>/discord-bot-template.git
cd discord-bot-template
# Using npm
npm install
# Or with Bun
bun install
Create a .env
file in the project root:
TOKEN=YOUR_DISCORD_BOT_TOKEN
MONGODB_URI=YOUR_MONGODB_CONNECTION_STRING
.
ββ src
β ββ commands # Slash command definitions
β ββ database
β β ββ dbConnection.ts
β β ββ models # Mongoose models
β ββ events # Discord event handlers
β ββ handlers # Custom event & command logic
β ββ types # TypeScript type definitions
β ββ utils # Utility functions (e.g., cooldowns)
ββ templates # HTML templates for image generation
ββ nodemon.json # Nodemon config
ββ package.json
ββ tsconfig.json
ββ README.md
Register commands
npm run registerCommands
Start development server
npm run dev
Or with Bun:
bun run dev
- Fork the repository π΄
- Create a new branch (
git checkout -b feature/YourFeature
) πΏ - Commit your changes (
git commit -m "Add some feature"
) π - Push to the branch (
git push origin feature/YourFeature
) π - Open a Pull Request π
This project is licensed under the ISC License. π