sakura-no-hana / hanalon-bot

An RPG Discord bot
MIT License
0 stars 0 forks source link

Hanalon

Codacy Badge Code style: black made-with-python Discord

Hanalon is an RPG Discord bot.

Requirements

Convenience

Docker w/ Kubernetes

Docker

Python

Usage

There are a few steps to use this Discord bot locally.

Running

Keep in mind that all of these processes need to be explicitly killed with perl scripts/hanalon.pl bot kill.

Killing

You can kill the bot with perl:
perl scripts/hanalon.pl bot kill

Or with bash, depending on how your bot was started:

Contributing

Pull requests are always welcome. Please open an issue so that other contributors may fix an issue if you are unable to fix it yourself. For feature requests and the like, please open issues.

Keep in mind that even as a side-project, we have standards here. Thus, we've set up a .pre-commit-config.yaml for your use. We currently only run a check with black, but the pre-commit hook makes sure that your code has sorted imports, is black compliant, and that your requirements.txt matches your poetry.lock.

Dependencies are managed by Poetry, which uses pyproject.toml. Do not manually edit the requirements.txt; either let pre-commit do it for you, or run poetry export -o requirements.txt --without-hashes.

Venv

It is highly recommended that you use a venv while developing. This makes it so inter-project dependency versions do not cause conflicts. You can create a venv with python3 -m venv .venv. You can then activate that venv with source .venv/bin/activate.

Testing

Tests are located in the tests directory and use pytest. Either use the perl script provided (perl scripts/hanalon.pl bot test --cov) or manually run them (pip3 install pytest ; pytest -v). There is no required code coverage, but writing tests is simply good practice; do it if you can, but it's not a big deal if you can't.