https://github.com/burakys/bot-template
Discord.js V14 TypeScript bot template with multi-language support
https://github.com/burakys/bot-template
bot bot-template discord discord-bot djs multi-language typescript
Last synced: 7 months ago
JSON representation
Discord.js V14 TypeScript bot template with multi-language support
- Host: GitHub
- URL: https://github.com/burakys/bot-template
- Owner: BurakYs
- License: mit
- Created: 2022-07-23T04:03:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-27T18:33:51.000Z (7 months ago)
- Last Synced: 2025-08-02T12:10:51.555Z (7 months ago)
- Topics: bot, bot-template, discord, discord-bot, djs, multi-language, typescript
- Language: TypeScript
- Homepage:
- Size: 353 KB
- Stars: 10
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🤖 Discord Bot Template
A TypeScript template for creating Discord bots with discord.js
## 📦 Setup
1. Clone the repo and install dependencies:
```sh
git clone https://github.com/BurakYs/bot-template.git
cd bot-template
pnpm install
cp .env.template .env
```
2. Add your bot token to the `.env` file
3. Register slash commands:
```sh
pnpm register-commands
```
4. Start the bot:
```sh
pnpm start
```
## ✨ Features
### 🌐 Localization
- Add new languages by:
- Creating a JSON file in `src/localizations`
- Updating the `supportedLanguages` array in `src/config.ts`
- Command names/descriptions are in `src/localizations/commandData`
### ⚙️ Command Handler
- Organize commands in subfolders under `src/commands`
- See [`types/index.d.ts`](src/types/index.d.ts#L19-L31) for config structure
- Example of a subcommand-specific config:
```ts
{
config: {
someOtherConfig: true,
premiumOnly: {
'*': false, // Default
'subcommandName': true, // Only for this subcommand
'groupName subcommandName': true, // For group subcommands
}
}
}
```
### 🛠 Utility Functions
- [`interaction.success()`](src/types/discordjs.d.ts#L10-L12) - Sends a success message
- [`interaction.error()`](src/types/discordjs.d.ts#L14-L16) - Sends an error message
- [`interaction.translate()`](src/types/discordjs.d.ts#L8) - Translates a key using the current language
## 📝 License
This project is licensed under the [MIT License](./LICENSE).