A nodejs powered Discord Bot template to quickly get you started building.
- Enable/Disable/Reset commands for admins.
- Message Embedding: Option to make bot reply with Discord embeddings
- Message splitter for longer messages that exceed 2000 characters
- nodejs
- npm
- dotenv
- Discord Application Bot
- Create a Discord Application Bot. You can follow this tutorial. Copy the bot token somewhere for usage later.
- Invite the bot to your server. You can follow this tutorial.
- Install NodeJS for your system. Refer to Google for installation based on OS.
- Clone this repo for starter template.
- Run
npm ci
to install NPM dependencies. - Copy
.env.example
to.env
and add all bot token and admin IDs into.env
. Change other options to your liking. - Run node
deploy-commands.js
to deploy the bot's slash commands to discord. - Finally, run
npm start
ornode index.js
to run the bot. - OPTIONAL Run the bot in a container if you want to keep your bot active. See below for instructions.
/enable
: Enables the bot./disable
: Disables the bot.
REPLY_MODE
- Whether or not bot should use Discord replies for messages.BOT_NAME
- Name of the bot.BOT_REPLIES
- Whether or not bot should reply to other bots (but never itself).EMBED_RESPONSE
- Whether or not to use embeds when responding (new features will be developed for true)
These env vars are dynamic based on the personality. Use "<p>" as a placeholder for the BOT_NAME
:
DYNAMIC_TITLE_MSG
- Bot message for the title of embeds. Will be wrapped in ** **.
- Ensure your
.env
file exists and is populated with the correct values. - Run
docker build -t <IMAGE_NAME_> .
to build the image. - Run
docker-compose up -d
to create a stack. This will mount the .env file to/app/.env
within the container.
This template is based off this original project by @Kevin8675.
I've been slowly adding features on my own bot, but thought this was a great starting point for a bot. Thanks!