This is a type-safe Discord.js v14 starter project I use to create my bots. I thought it would be helpful to share it with the world, so you can save some time.
Clone this repo or press the "use the template button" to Installation
All the config files are stored in
src/data
- Step 1: Rename
.env.exampleto.envand fill the details
TOKEN= DISCORD BOT TOKEN
APPLICATION_ID= CLIENT ID
GUILD_ID= PRIVATE SERVER ID
MONGO_DB_URI= MONGO DB CONNECTION URI
PRIVATE_COMMAND_USER_IDS= 12345, 54321 (dev user ids)
WEBHOOK_URL= WEBHOOK FOR ERROR HANDLING
REDIS_URI= REDIS FOR CACHING (recommend to use local redis instance)
- Step 2 Update
config.jsonhowever you want (recommended to use app emojis)
{
"colors": {
"default": "#5865F2",
"success": "#57F287",
"error": "#ED4245",
"info": "#3BA5E0",
"warning": "#FEE75C"
},
"emojis": {
"success": "<:success:1262666464646464646>",
"error": "<:error:1262666464646464646>",
"info": "<:info:1262666464646464646>",
"warning": "<:warning:1262666464646464646>"
}
}- Step 3: Run the following command using your package manager of choice.
npm install
yarn install
pnpm install
bun install
To run your app in dev mode run
pnpm devor to run your app in productionpnpm buildandpnpm start
- Flags
--publicCommandsOnly- Registers only public commands.--privateCommandsOnly- Registers only private commands in the specified private guild in.env.
Passing no flags will register all commands
If you encounter any issues, please create an issue.
I also recommend that you join my Discord server in case of any errors or if you need any help