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: 5 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 (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-08T16:14:03.000Z (5 months ago)
- Last Synced: 2025-02-08T17:19:10.281Z (5 months ago)
- Topics: bot, bot-template, discord, discord-bot, djs, multi-language, typescript
- Language: TypeScript
- Homepage:
- Size: 341 KB
- Stars: 9
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🤖 Discord Bot Template
A template for creating Discord bots with Discord.js using TypeScript
[🇹🇷 Bu dosyanın Türkçe hali](./README.tr.md)
## 📦 Installation
1. Run this codeblock in your terminal:
```bash
git clone https://github.com/BurakYs/bot-template.git
cd bot-template
npm install
cp .env.template .env
npm run build
```
2. Fill in the `.env` file with your bot token
3. Run `npm run register-commands` to register the commands
4. Start the bot with `npm start`## ✨ Features
- ### Multiple Language Support
- Uses the `i18next` library for localization
- To add a new language, add the file in `src/localizations` folder and update `supportedLanguages` array in `src/config.ts`
- Command names and descriptions are stored in the `src/localizations/commandData` folder
- Ensure the values in `supportedLanguages` match the files' name in the `src/localizations` folder- ### Command Handler
- You can create as many subfolders as you want in the `src/commands` folder
- Refer to the available command configurations in the [types](./src/types/index.ts#L12-L22) file
- To give a subcommand a specific configuration, do this:
```ts
config: {
someOtherConfig: true,
configName: {
'*': false, // Default configuration
'groupName subCommandName': true, // Specific configuration for this subcommand
// or
'subCommandName': true
}
}
```- ### Utility Functions
- `interaction.success()`: Sends a success message
- `interaction.error()`: Sends an error message
- `interaction.translate()`: Translates a key## 📝 License
This project is licensed under the [MIT License](./LICENSE) - see the [LICENSE](./LICENSE) file for details.