This repository is home to all the code used by CostBot, an MIT-licensed Discord bot coded in TypeScript with the help of discord.js.
- Node.js version 16.9.0 or newer (LTS release recommended)
- npm installed (pre-installed with Node)
- Git installed
- A Discord server for privileged commands
-
First, you will need an application, which you can create in Discord's Developer Portal. Once it is created, add a bot to the application and click the "Reset Token" button to access its credentials, which you will need later.
-
Once everything is installed, open your terminal and paste the following command:
git clone https://github.com/Costpap/CostBot.git
. You'll now see a new directory called "CostBot" which contains all of the bot's source code. Runcd CostBot
, thennpm install
. If you get a warning from npm regarding peer or optional dependencies, you can ignore it. -
After all dependencies have been installed, you will need to setup the configuration files. Rename
.env.example
to.env
and replace all the fields with appropriate values. Then go to the/src
directory, renamebotconfig-example.ts
tobotconfig.ts
then replace all of the values as well. -
You will now need to compile the TypeScript code, which can be done by running
npm run build
. If you get any build errors, please open an issue. -
Before starting the bot, you need to register its commands with Discord by running
npm run commands set [guild id for privileged commands]
.
npm run commands set 613425648685547541
). Additionally, the authors of CostBot are not responsible for any damage arising from misuse of such commands and disclaim all warranties, in accordance with the terms of the MIT license.
- You can now run
npm run start
to start up CostBot 🎉
If you are planning to make contributions to the bot, please make yourself aware of the Code of Conduct and Contributing Guidelines.