https://github.com/xjectro/typescript-discord-bot
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.
https://github.com/xjectro/typescript-discord-bot
boilerplate bot bot-framework bots discord discord-api discord-bot discord-bot-template discord-js discord-tool discordapp discordbot discordjs example framework shard sharding starter template typescript
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/xjectro/typescript-discord-bot
- Owner: Xjectro
- License: mit
- Created: 2024-08-08T05:32:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-11T20:33:04.000Z (9 months ago)
- Last Synced: 2025-06-17T05:38:01.842Z (8 months ago)
- Topics: boilerplate, bot, bot-framework, bots, discord, discord-api, discord-bot, discord-bot-template, discord-js, discord-tool, discordapp, discordbot, discordjs, example, framework, shard, sharding, starter, template, typescript
- Language: TypeScript
- Homepage: https://xjectro.com/
- Size: 54.7 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎉 Discord Bot Template 🚀
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.
## ✨ Features
- ⚡️ 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`
## 🛠️ Requirements
- Node.js v18 or higher
- Bun (optional) or Nodemon
- MongoDB connection URI
- Discord Bot Token
## 🚀 Installation
```powershell
git clone https://github.com//discord-bot-template.git
cd discord-bot-template
# Using npm
npm install
# Or with Bun
bun install
```
## 🔑 Environment Variables
Create a `.env` file in the project root:
```env
TOKEN=YOUR_DISCORD_BOT_TOKEN
MONGODB_URI=YOUR_MONGODB_CONNECTION_STRING
```
## 📂 Project Structure
```
.
├─ 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
```
## ⚙️ Usage
> **Register commands**
```powershell
npm run registerCommands
```
> **Start development server**
```powershell
npm run dev
```
> Or with Bun:
```powershell
bun run dev
```
## 🤝 Contributing
1. Fork the repository 🍴
2. Create a new branch (`git checkout -b feature/YourFeature`) 🌿
3. Commit your changes (`git commit -m "Add some feature"`) 📝
4. Push to the branch (`git push origin feature/YourFeature`) 🚀
5. Open a Pull Request 🎉
## 📄 License
This project is licensed under the ISC License. 🚀