diff --git a/README.md b/README.md index 045cca4..3d0b815 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Check out `help(Bot)` for detailed information. ## Webhook additional information To run a bot in webhook modality, you have to provide a `hostname` and `certificate` at bot instantiation and a `local_host` and `port` when calling `Bot.run` method. * Telegram will send POST requests at `https://{hostname}/webhook/{tokens}/` using `certificate` for encryption -* `aiohttp.web.Application` server will listen `http://{local_host}:{port}` for updates +* `aiohttp.web.Application` server will listen on `http://{local_host}:{port}` for updates It is therefore required a reverse proxy passing incoming requests to local_host. @@ -71,9 +71,27 @@ server { **Example of python configuration file in this situation** ```python -# File config.py, gitignored and imported in main script +# File data/config.py, gitignored and imported in main script hostname = "https://www.example.com:8553/telegram" certificate = "/path/to/fullchain.pem" local_host = "127.0.0.5" port = 8552 + +# Main script +from data.config import hostname, certificate, local_host, port +from data.passwords import bot_token +from davtelepot.bot import Bot + +my_bot = Bot( + token=bot_token, + hostname=hostname, + certificate=certificate +) + +# ... + +Bot.run( + local_host=local_host, + port=port +) ``` diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index 4778882..8b0f041 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -7,7 +7,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.0.5" +__version__ = "2.0.6" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte"