I made this to experiment with my code and nothing else.
This is the source code for the official Discord bot of The Coding Empire Discord community.
Contributions are always welcome! Please read the contribution guidelines first. Few things to keep in mind:
- This is a bog-standard TypeScript project. If you're not familiar with TypeScript, you can learn it here.
- Ensure you install the dev dependencies using
npm install --save-devbefore making any changes. - Please follow the conventional commit guidelines while making commits. ("changed things" is not a good commit message)
- Please make sure your code is properly formatted. We have provided a prettier setup.
- Test your code before making a pull request. We have a CI/CD pipeline set up, but it's always better to test your code locally before making a pull request.
- Docker (recommend for running the database locally)
- Node.js (v14 or higher)
- MongoDB (local or remote)
- Discord bot
- DangerCord API Key (optional)
- GitHub token (optional)
Setting up the database is pretty straightforward. All you need to do is run a local instance of MongoDB. You can do this by running docker-compose up -d (sudo docker compose up -d, if you're on Linux) in the root directory of this project. If you don't have Docker installed, you can install it from here.
Or, you can use a tool such as MongoDB Compass to connect to a remote database, or run a local instance of MongoDB.
- Rename
.env.exampleto.envand fill out the necessary information. - To run your bot, you could use
npm run devornpm run watch, if you want Nodemon to take care of you and automatically restart the the bot on every change. - Alternatively, you can use
docker-compose up -build.
Use docker-compose up -d to run the bot in production mode. This will build the bot and run it in a container. You can use docker-compose down to stop the bot.
If you've got any questions, feel free to join our Discord community.