A modern Discord bot template built with TypeScript for scalable and maintainable bot development.
- 🤖 Discord.js v14 framework
- 📘 TypeScript for type safety
- ⚡ Slash commands support
- 🛠️ Development tools configured
- 🔧 Environment configuration
- Node.js (version 18 or higher)
- npm or yarn
- Discord Bot Token
Clone this repository and install dependencies:
git clone https://github.com/Under-scape/discordbot-ts-template
cd discordbot-ts-template
npm install- Create a
.envfile in the root directory - Add your Discord bot token:
DISCORD_TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_herenpm run startStart the bot.
npm run buildCompile TypeScript to JavaScript for production.
npm run startStart the production bot (requires build first).
npm run registerDeploy slash commands to Discord.
- Install dependencies:
npm install - Configure your
.envfile with bot credentials - For start
npm run start
For development:
npm run startFor production:
npm run startBuild the Docker image and run the container:
docker buildx build -t discord-bot . && docker run -d --restart unless-stopped --name discord-bot discord-botStop the container:
docker stop discord-botStart the container (after stop):
docker start discord-botView container logs:
docker logs -f discord-botRemove the container:
docker rm discord-botStop, remove, rebuild and redeploy:
docker stop discord-bot && docker rm discord-bot && docker buildx build -t discord-bot . && docker run -d --restart unless-stopped --name discord-bot discord-botNote: This template is based on community best practices and has been customized for Discord bot development.