A TypeScript template for creating Discord bots with discord.js
-
Clone the repo and install dependencies:
git clone https://github.com/BurakYs/bot-template.git cd bot-template pnpm install cp .env.template .env
-
Add your bot token to the
.env
file -
Register slash commands:
pnpm register-commands
-
Start the bot:
pnpm start
- Add new languages by:
- Creating a JSON file in
src/localizations
- Updating the
supportedLanguages
array insrc/config.ts
- Creating a JSON file in
- Command names/descriptions are in
src/localizations/commandData
- Organize commands in subfolders under
src/commands
- See
types/index.d.ts
for config structure - Example of a subcommand-specific config:
{ config: { someOtherConfig: true, premiumOnly: { '*': false, // Default 'subcommandName': true, // Only for this subcommand 'groupName subcommandName': true, // For group subcommands } } }
interaction.success()
- Sends a success messageinteraction.error()
- Sends an error messageinteraction.translate()
- Translates a key using the current language
This project is licensed under the MIT License.