Bot is deployed on GCP, it's telegram username is
@weathercounterbot
. Some latency may be experienced (mostly due to cold starts)
Important
Ensure the .env
file has the following entries with their respective API keys.
OPENAI_API_KEY
BOT_KEY
WEATHER_KEY
Note
To use webhooks, you can set the PORT
and URL
environment variables.
PORT needs to be one of 443, 80, 88 or 8443 (only ports supported by Telegram's API).
URL is the publicly accessible URL of the device (http(s)://<domain_or_ip>/
).
- Build image
docker build . -t <image_name>
- Run container with environment variables from
.env
filedocker run --env-file .env <image_name>
- Ensure Python 3.12+ is installed.
- Ensure poetry is installed.
- Run
poetry install
to install dependencies. - Run the project with
poetry run main
- Would it be out of scope to get rid of the buttons and use function calling? Wouldn't that result in too many chat completions?
- If the bot is in a group, should the counter be unique for each user?
- Should the counts be persisted?
The current implementation uses polling to get updates from Telegram's API. For an event based approach, it's possible to use webhooks instead, which would reduce unnecessary resource usage.- What's worth testing?
- The counter is the only functionality with fixed, testable, expected behaviours, but it's too basic and simple (add tests for the sake of it?).
- Testing with
python-telegram-bot
should be possible