Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 3.16 KB

README.md

File metadata and controls

32 lines (27 loc) · 3.16 KB

Rubot2

Build GitHub top language GitHub repo size Commands

A general Purpose Discord Bot.

Development Setup

  • Clone the Repository
  • Either use the docker compose file to start a mongodb instance or install mongodb locally
    • To use the docker compose file run docker-compose -f docker-compose.development.yml up -d
  • Setup a .env File
    • TOKEN is the Discord Bot Token. To see how to create a Discord Bot see Setup.md
    • OWNER_ID is the Discord ID of the Bot Owner. To get your Discord ID enable Developer Mode in the Discord Settings and right click on your name in the User List.
    • CLIENT_ID is the Discord ID of the Bot. To get the ID go to the Discord Developer Portal and select your application. The ID is displayed under the name of the application. Alternatively enable Developer Mode in the Discord Settings and right click on the Bot in the User List to copy the ID.
    • MONGODB_USER is the Username for the Mongodb Database. If you use the docker compose development file you can freely choose the value. If you use a local instance of mongodb you have to create a new user and give it access to the database you want to use.
    • MONGODB_PASSWORD is the Password for the Mongodb Database. If you use the docker compose development file you can freely choose the value. If you use a local instance of mongodb you have to create a new user and give it access to the database you want to use.
    • MONGODB_DBNAME is the Name of the Mongodb Database. If you use the docker compose development file you can freely choose the value. If you use a local instance of mongodb you have to create a new user and give it access to the database you want to use.
    • MONGODB_CONNECTION_URL is the Connection String for the Mongodb Database. The connection string should look like this: mongodb://<user>:<password>@<host>:<port>/<database>?authSource=admin make sure to replace the values with the ones you chose above, host and port should be localhost or 127.0.0.1 and 27017 respectively.
  • Install the Dependencies with npm install
  • Run npm start to compile and run the Bot in development mode

Setup for manual Testing

See Setup.md.

Setup pre-commit hook

install the python package pre-commit (e.g. with pip install pre-commit or pipx install pre-commit) and run pre-commit install in the repository root directory. This will ensure the code is formatted correctly before every commit. You can also manually run it with pre-commit run -a. If you for some reason want to skip the pre-commit hook you can use git commit --no-verify (which you should never do).

Deployment

  • Run npm build once to compile to the dist directory on the target device
  • Start the index.js in the dist directory