General Purpose discord bot
| Items | Version |
|---|---|
| npm | ^8.1.0 |
| node | ^17.0.1 |
- Install all dependencies
npm ci
- Set environment variable
| Key | Description |
|---|---|
| TOKEN | Discord bot token |
| CLIENT_ID | Discord bot client_id |
| CLIENT_SECRET | Discord bot client_secret |
| APPLICATION_ID | Discord bot application id |
| DEBUG_GUILD_ID | Discord Server ID of the server you like to test this on |
| DEBUG | Set this to non-empty value to run the bot in debug mode (Note: Bot runs in production mode by default) |
- Deploy the slash commands
NOTE 1: If DEBUG is set, the commands will only be deployed to specified DEBUG_GUILD_ID
NOTE 2: Always install devDeps during slash command deployment
npm run deploy
- Run the bot
Development:
# Choose one of these
npm run dev # Run nodemon
npm run debug # Run nodemon with --inspect flagProduction:
npm run build # Compiles source code
npm start # Run compiled files