A boilerplate to get a bot running using discord.js with TypeScript. Includes support for all current Discord interaction types and client events.
-
Clone the repository.
-
Run
pnpm install
. -
Create a
.env
file then add your client id and bot token from the Discord Developer Portal.
CLIENT_ID=
TOKEN=
-
Create interactions in
src/interaction/<type>
and event handlers insrc/events
. File names must exactly match the discord.js event name or interaction id/name as this is how the interactionCreate finds the correct execution. -
Run
pnpm dev
to start the bot and restart on file changes. -
Run
pnpm deploy-commands
to push command changes to Discord.