This is the customized Discord Bot developed by myself.
- Create and enter the virtual environment:
python3.x -m venv v3x; . ./v3x/bin/activate
- Update
pip
:pip install --upgrade pip
- Install the project in editable mode along with the development dependencies:
pip install -e .[dev]
To start the bot, a valid credential config file should be provided.
A template credential file is given under doc
directory.
python start.py --credential $PATH_TO_CREDENTIAL_FILE
Before submitting a pull request, run the following error-checking and formatting tools:
- mypy:
mypy src
- mypy checks for typing errors. You should resolve all typing errors or if an
error cannot be resolved (e.g., it's due to a third-party library), you
should add a comment
# type: ignore
to silence the error.
- mypy checks for typing errors. You should resolve all typing errors or if an
error cannot be resolved (e.g., it's due to a third-party library), you
should add a comment
- docformatter:
docformatter -i src
- This formats docstrings. You should review and add any changes to your PR.
- Black:
black src
- This formats the code according to Black's code-style rules. You should review and add any changes to your PR.
- ruff:
ruff check --fix src
- This performs linting according to PEPs. You should review and add any changes to your PR.
Note that docformatter
should be run before black
to give Black the last.