{"id":34652894,"url":"https://github.com/obervinov/telegram-assistant","last_synced_at":"2026-05-27T15:04:45.204Z","repository":{"id":151980424,"uuid":"562421516","full_name":"obervinov/telegram-assistant","owner":"obervinov","description":"This project is a Telegram bot that helps with everyday tasks, such as keeping track of finances or achieving goals.","archived":false,"fork":false,"pushed_at":"2025-04-09T11:52:28.000Z","size":2180,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T12:35:22.390Z","etag":null,"topics":["assistant","assistant-chat-bots","finance","finance-management","finance-tracker","financial-analysis","goals","goals-tracker","reminder","reminder-bot","telegram","telegram-bot","telegram-bot-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obervinov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-06T10:03:30.000Z","updated_at":"2024-09-29T20:56:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"781584ba-417d-448b-8c97-09fa930b27c8","html_url":"https://github.com/obervinov/telegram-assistant","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/obervinov/telegram-assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obervinov","download_url":"https://codeload.github.com/obervinov/telegram-assistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-assistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33571016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assistant","assistant-chat-bots","finance","finance-management","finance-tracker","financial-analysis","goals","goals-tracker","reminder","reminder-bot","telegram","telegram-bot","telegram-bot-api"],"created_at":"2025-12-24T17:58:32.265Z","updated_at":"2026-05-27T15:04:45.198Z","avatar_url":"https://github.com/obervinov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram-assistent\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/obervinov/telegram-assistent?style=for-the-badge)\n![GitHub last commit](https://img.shields.io/github/last-commit/obervinov/telegram-assistent?style=for-the-badge)\n![GitHub Release Date](https://img.shields.io/github/release-date/obervinov/telegram-assistent?style=for-the-badge)\n![GitHub issues](https://img.shields.io/github/issues/obervinov/telegram-assistent?style=for-the-badge)\n![GitHub repo size](https://img.shields.io/github/repo-size/obervinov/telegram-assistent?style=for-the-badge)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/instaloader?style=for-the-badge)\n\n## \u003cimg src=\"https://github.com/obervinov/content/blob/main/ico/1945958.png\" width=\"25\" title=\"about\"\u003e About this project\nThis bot helps to fix financial expenses on the basis of which it builds monthly reports.\u003cbr\u003e\u003c/br\u003e\nMain functions:\n- accounting of income and expenses\n- generating monthly reports\n\n\nThe vault is used for:\n- storage of sensitive configuration parameters\n- storage of financial expenses and income\n- storing user authorization events\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/bot-preview.gif\" width=\"1000\" title=\"bot-preview\"\u003e\n\u003c/p\u003e\n\n## \u003cimg src=\"https://github.com/obervinov/content/blob/main/ico/7711245.png\" width=\"25\" title=\"map\"\u003e Repository map\n```sh\n.\n├── Dockerfile                ### Manifest for building docker-image\n├── LICENSE                   ### License info\n├── README.md                 ### The file you're reading now\n├── CHANGELOG.md              ### All notable changes to this project will be documented in this file\n├── bot.py                    ### Main file with code this project\n├── docker-compose.yml        ### Manifest for building and running project with all dependencies\n├── requirements.txt          ### List of python dependencies\n└── doc                       ### Directory with content for documentation\n    ├── bot-preview.gif         # Gif animation with a demonstration of the work of bots\n─── src                       ### Extended modules\n    ├── finance.py              # A code file containing a class and methods for processing the entered data and saving them to vault\n    └── messages.py             # A code file containing a class and methods for generating beautiful messages with responses\n\n2 directory, 9 files\n```\n\n## \u003cimg src=\"https://github.com/obervinov/content/blob/main/ico/8823344.png\" width=\"25\" title=\"requirements\"\u003e Requirements\n- \u003cimg src=\"https://github.com/obervinov/content/blob/main/ico/1597163356-vault-favicon.png\" width=\"15\" title=\"vault-ico\"\u003e Vault server - [a storage of secrets for bot with kv v2 engine](https://developer.hashicorp.com/vault/docs/secrets/kv/kv-v2)\n- \u003cimg src=\"https://github.com/obervinov/content/blob/main/ico/t_logo.png\" width=\"15\" title=\"telegram-ico\"\u003e Telegram bot api token - [instructions for creating bot and getting a token of api](https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-telegram?view=azure-bot-service-4.0)\n\n## Environment variables\n\n| Variable  | Description | Default |\n| ------------- | ------------- | ------------- |\n| `BOT_VAULT_APPROLE_ID`  | [Approve-id created during vault setup](https://developer.hashicorp.com/vault/docs/auth/approle) | `not set` |\n| `BOT_VAULT_APPROLE_SECRET_ID`  | [Approve-secret-id created during vault setup](https://developer.hashicorp.com/vault/docs/auth/approle) | `not set` |\n| `BOT_VAULT_ADDR`  | The address at which the vault server will be available to the bot | `http://vault-server:8200` |\n| `BOT_NAME` | The name of the bot | `telegram-assistent` |\n| `BOT_VAULT_MOUNT_PATH` | The point of mounting secrets in the vault | `secretv2` |\n\n## \u003cimg src=\"https://github.com/obervinov/content/blob/main/ico/2366710.png\" width=\"25\" title=\"docker\"\u003e How to run with docker-compose\n1. Building and launching docker container with vault-server\n```sh\ndocker-compose up -d vault-server\n```\n\n2. Configuration vault-server\n```sh\n# Go to the interactive shell of the vault container\ndocker exec -ti vault-server sh\n\n# Init vault server\nvault operator init\n\n# Login in vault-server with root token\n# ${VAULT_ROOT_TOKEN} - Root token for vault login. Substitute your own value instead of a variable. The root token was received in the output at the previous step\nvault login ${VAULT_ROOT_TOKEN} -address=http://0.0.0.0:8200\n\n# Enabling secret engine - kv version 2\nvault secrets enable -version=2 -path=secretv2 kv\n\n# Enabling auth with approle method\nvault auth enable approle\n\n### ${BOT_NAME} - your bot's name. Substitute your own value instead of a variable. For example: \"telegram-assistent\"\n\n# Write policy rules to file in container\ntee ${BOT_NAME}-policy.htl \u003c\u003cEOF\npath \"secretv2/config\" {\n  capabilities = [\"create\", \"read\", \"update\", \"list\"]\n}\npath \"secretv2/data/${BOT_NAME}-config/config\" {\n  capabilities = [\"read\", \"list\"]\n}\npath \"secretv2/data/${BOT_NAME}-data/*\" {\n  capabilities = [\"create\", \"read\", \"update\", \"list\"]\n}\npath \"secretv2/metadata/${BOT_NAME}-data/*\" {\n  capabilities = [\"read\", \"list\"]\n}\npath \"secretv2/data/${BOT_NAME}-login-events/*\" {\n  capabilities = [\"create\", \"read\", \"update\"]\n}\nEOF\n\n# Creating policy for approle\nvault policy write ${BOT_NAME}-policy ${BOT_NAME}-policy.htl\n\n# Creating approle for bot\nvault write auth/approle/role/${BOT_NAME}-approle role_name=\"${BOT_NAME}-approle\" policies=\"${BOT_NAME}-policy\" secret_id_num_uses=0 token_num_uses=0 token_type=default token_ttl=720h token_policies=\"${BOT_NAME}-policy\" bind_secret_id=true token_no_default_policy=true\n\n# Creating secret-id by approle (the secret-id received after executing the command will be required for the bot to work)\nvault write auth/approle/role/${BOT_NAME}-approle/secret-id role_name=\"${BOT_NAME}-approle\" metadata=\"bot=${BOT_NAME}\"\n\n# Reading role-id (the role-id received after executing the command will be required for the bot to work)\nvault read auth/approle/role/${BOT_NAME}-approle/role-id\n```\n\n3. Loading the config for the bot (in the interactive shell of the vault container)\n```sh\n# Uploading the bot configuration containing sensitive data to the vault\n# ${TELEGRAM_API_TOKEN} - your bot's api token\n# ${YOUR_TELEGRAM_ID} - telegram id of your account for authorization of messages sent by the bot (whitelist)\nvault kv put secretv2/${BOT_NAME}-config/config b_token=\"${TELEGRAM_API_TOKEN}\" whitelist=\"${YOUR_TELEGRAM_ID}\"\n\n# Loading report categories (to summarize expenses by category). For example:\nvault kv put secretv2/${BOT_NAME}-data/categories \"mandatory payments\"=\"['credit for the car', 'rent an apartment', 'utilities', 'mobile communication','subscriptions']\" food=\"['supermarket', 'fresh vegetables', 'bakery products']\" cat=\"['cat food','filler']\"\n\n### Exiting the container shell ###\n```\n4. Setting environment variables in the host OS (the required values must be obtained at the vault configuration step)\n```sh\nexpot BOT_VAULT_APPROLE_ID=\"change_me\"\nexpot BOT_VAULT_APPROLE_SECRET_ID=\"change_me\"\n```\n\n5. Running bot\n```sh\ndocker-compose up -d ${BOT_NAME}\n```\n\n6. Viewing logs\n```sh\ndocker logs -f ${BOT_NAME}\n```\n\n## \u003cimg src=\"https://github.com/obervinov/content/blob/main/ico/8840892.png\" width=\"25\" title=\"locally\"\u003e How to run a bot locally without a docker\n**You need an already running and configured vault to use the approle and kv v2 engine**\n1. Installing python requirements\n```sh\npython3 -m pip install --upgrade pip\npip3 install -r requirements.txt\n```\n2. Uploading the bot configuration containing sensitive data to the vault\n```sh\n# ${TELEGRAM_API_TOKEN} - your bot's api token\n# ${YOUR_TELEGRAM_ID} - telegram id of your account for authorization of messages sent by the bot (whitelist)\nvault kv put secretv2/${BOT_NAME}-config/config b_token=\"${TELEGRAM_API_TOKEN}\" whitelist=\"${YOUR_TELEGRAM_ID}\"\n```\n3. Setting environment variables in the host OS (the required values must be obtained at the vault configuration step)\n```sh\nexpot BOT_VAULT_APPROLE_ID=\"change_me\"\nexpot BOT_VAULT_APPROLE_SECRET_ID=\"change_me\"\n```\n4. Running bot\n```sh\npython3 bot.py\n```\n\n## \u003cimg src=\"https://github.com/obervinov/content/blob/main/ico/7264022.png\" width=\"25\" title=\"build\"\u003e How to build a docker image with a bot\n```sh\nexport BOT_VERSION=v1.0.0\nexport BOT_NAME=\"telegram-assistent\"\ndocker build -t ghcr.io/${GITHUB_USERNAME}/${BOT_NAME}:${BOT_VERSION} . --build-arg BOT_NAME=${BOT_NAME}\ndocker push ghcr.io/${GITHUB_USERNAME}/${BOT_NAME}:${BOT_VERSION}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobervinov%2Ftelegram-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobervinov%2Ftelegram-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobervinov%2Ftelegram-assistant/lists"}