Hosting a discord bot comes with some requirements:
Assuming you have Node.js installed, install the required packages:
Please use the latest version on Node.js, as this project is constantly keeping up to date. discord-bot-template is built and tested with the latest version of Node.js (as of now that is v14.4.0)
- In the project folder:
yarn install
-
In the config directory, make a copy of
main.example.json
, rename it tomain.json
. -
Fill in the necessary values, remove the comment (since comments are not supported in JSON).
owners
may be an array of strings
-
Customize what your bot says and does, here's what you should change:
- Status messages in
src/client/BotClient.ts
- Your bot's description in
src/commands/basic/AboutCommand.ts
- The required permissions in
src/commands/basic/InviteCommand.ts
- Status messages in
{
"clientToken": "<Discord Bot Token>",
"webhook": {
"id": "",
"secret": ""
},
"prefix": ">",
"owners": "<Your Discord ID>",
// OR
"owners": ["<Your Discord ID>", "<Another Discord ID>"]
}
To start the bot, it must first be complied.
-
Run
yarn run build
-
You may then start with
yarn start
or, if you have pm2 installed:pm2 start pm2-start.json
-
Alternatively: Run
yarn run cs
to build and then start.
Credits to Hydractify for their logging system.
discord-bot-template is released under the MIT License.