diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ac5c2f..b7f1084 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,5 @@ +# Contributing + Hello everybody! 💪 Any contribution to this project is appreciated and welcomed 😎 @@ -12,3 +14,43 @@ See this [PR example](https://github.com/iamgiolaga/partitelle-bot/pull/20) Best, Giovanni + +## Init the environment + +To init the environment, run the following commands: + +```bash +pyenv install +pyenv local +pip install -r requirements.txt +``` + +Make sure that the python version is the one specified in the `.python-version` file: + +```bash +python --version +``` + +Create a `.env` file and fill it with the correct values. You can use the `default.env` file as a template. + +## Run the tests + +To run the tests, run the following command: + +```bash +python -m unittest discover test +``` + +## Run the bot + +To run the bot, run the following command: + +```bash +python main.py +``` + +If you're running the bot locally (ENV = local), the bot will start polling messages from Telegram. + +If you're running the bot on other environments (ENV != local), the bot will start a webhook listener instead. + +This is useful to test the bot on a local environment before pushing the changes to the remote server. diff --git a/default.env b/default.env new file mode 100644 index 0000000..f67dc27 --- /dev/null +++ b/default.env @@ -0,0 +1,8 @@ +PB_TG_TOKEN = "" +PB_URL = "" +PB_DB_TABLE_NAME = "" +PB_DB_HOST = "" +PB_DB_NAME = "" +PB_DB_USER = "" +PB_DB_PASSWORD = "" +PB_DB_PORT = \ No newline at end of file