This Tribecamp repository follows the Tribecamp Style Guide, which follows the Airbnb JavaScript Style Guide. We expect everyone to strictly follow this style guide. Before you either push a commit or create a Pull Request, please check if there are no linter errors present. We recommend using Visual Studio Code (or VSCodium, if you're concerned about your privacy) with the ESLint plugin installed for automatic linting.
We have adopted Conventional Commits as a ruleset for commit messages. In short, commit messages must be formatted using one the following prefixes:
build
– for changes made to the build systemchore
– for changes that do not change production codeci
– for changes made to Continuous Integration (CI) configurationdocs
– for updates made to the documentationfeat
– for newly introduced featuresfix
– for bug fixes and patchesimprovement
– for overall made improvementsperf
– for changes optimizing the overall performancerefactor
– for refactored code that does not change the public Discord botrevert
– for when reverting back to a previous commitstyle
– for code style changes (such as indentation)test
– for when adding tests or assertions
Examples:
feat: add ban command
refactor: remove unused var
You may also specify a scope. We strongly encourage you to use scopes, because it's an excellent way of determining what part of the codebase has been changed.
Example:
feat(ban): add ability to ban a specific member
- yarn (
npm install -g yarn
) - NodeJS
In your shell of choice, run:
git clone https://github.com/tribecamp/discord-bot/ # clone the repo
yarn install # install all the dependencies
yarn compile # compile the source
yarn dev # start the developer environment
Move src/config/env.example
to the root directory and rename it to .env
, and fill in your Discord bot token, which you can find here.
If you want to use hot reloading in yarn dev
, you'll have to install the Run on Save extension on Visual Studio Code.
The following commands might come in handy:
Command | Description |
---|---|
yarn dev |
Spins up the development environment. |
yarn build |
Builds all the necessary Docker images for prooduction. |
yarn compile |
Compiles all package sources. |
yarn lint:fix |
Runs ESLint & automatically fix linter errors (do this frequently!) |