Discord bot - A discord.js bot for Topcoder Community written with TypeScript.
This code was forked from https://github.com/KevinNovak/Discord-Bot-TypeScript-Template originally and modified to suit Topcoder needs.
This bot has a few example commands which can be modified as needed.
A /help
command with a bot description, list of commands, and important links.
A generic command, /test
, which can be copied to create additional commands.
An /info
command, which shows more information and relevant links.
A /dev
command, which shows detailed information that may be helpful to developers.
A /link
command, which provides relevant links (invite
, support
, docs
, vote
, donate
).
A welcome message is sent to the server and owner when the bot is added.
- Copy example config files.
- Navigate to the
config
folder of this project. - Copy all files ending in
.example.json
and remove the.example
from the copied file names.- Ex:
config.example.json
should be copied and renamed asconfig.json
.
- Ex:
- Navigate to the
- Obtain a bot token.
- You'll need to create a new bot in your Discord Developer Portal.
- See here for detailed instructions.
- At the end you should have a bot token.
- You'll need to create a new bot in your Discord Developer Portal.
- Modify the config file.
- Open the
config/config.json
file. - You'll need to edit the following values:
client.id
- Your discord bot's user ID.client.token
- Your discord bot's token.
- Open the
- Install packages.
- Navigate into the downloaded source files and type
npm install
.
- Navigate into the downloaded source files and type
- Register commands.
- In order to use slash commands, they first have to be registered.
- Type
npm run register
to register the bot's commands.- Run this script any time you change a command name, structure, or add/remove commands.
- This is so Discord knows what your commands look like.
- It may take up to an hour for command changes to appear.
You can run the bot in 4 different modes:
- Normal Mode
- Type
npm start
. - This runs the bot directly with Node and without shards.
- Use this mode if you don't need sharding.
- Type
- Dev Mode
- Type
npm start:dev
. - This runs the bot with ts-node-dev.
- Use this mode for general development.
- TypeScript files are compiled automatically as they are changed.
- Type
- Shard Mode
- Type
npm run start:shard
. - This runs the bot directly with Node and with sharding enabled.
- Use this mode if you need sharding.
- Type
- PM2 Mode
- Run by typing
npm run start:pm2
. - This runs the bot using the process manager PM2.
- Use this mode if you require the bot to always be online.
- Run by typing
For questions, proposals and ideas feel free to contact the team behind this bot: