Skip to content
/ bot-template Public template

Discord.js V14 TypeScript bot template with multi-language support

License

Notifications You must be signed in to change notification settings

BurakYs/bot-template

Repository files navigation

🤖 Discord Bot Template

A TypeScript template for creating Discord bots with discord.js

📦 Setup

  1. Clone the repo and install dependencies:

    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:

    pnpm register-commands
  4. Start the bot:

    pnpm start

✨ Features

🌐 Localization

  • Add new languages by:
    • Creating a JSON file in src/localizations
    • Updating the supportedLanguages array in src/config.ts

⚙️ Command Handler

  • Organize commands in subfolders under src/commands
  • See types/index.d.ts for config structure
  • Example of a subcommand-specific config:
    defineCommand({
        data: new SlashCommandBuilder() /* ... */,
        config: {
            guildOnly: true,
            premiumOnly: { 
                '*': false, // Default
                'subcommandName': true, // Only applies to "subcommandName"
                'subcommandGroupName subcommandName': true // Only applies to "subcommandName" in "subcommandGroupName"
            }
        },
        run: async ({ client, interaction }) => {
            // command logic
        }
    });

🛠 Utility Functions

📝 License

This project is licensed under the MIT License.

About

Discord.js V14 TypeScript bot template with multi-language support

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors 2

  •  
  •