This is a template for a discord bot written in typescript. It uses discord.js.
- Node.js (v16.6.0 or higher)
- Git
- Visual Studio Code (optional)
- pm2 (optional -- for production)
- Template the repository by clicking the green "Use this template" button on the top of the page.
- Clone the repository to your local machine.
- Open the repository in your terminal and run
npm install
to install all dependencies. - Create a
.env
file in the root directory of the repository and add follow the template in .example.env. - Run
npm run dev
to start the bot in development mode.
- Go to the Discord Developer Portal.
- Create a new application.
- Go to the "Bot" tab and create a new bot.
- Copy the token and paste it into the
.env
file. - Copy the client ID and paste it into the
.env
file.
You can follow the Discord.js Guide for more information.