{"id":34653016,"url":"https://github.com/obervinov/telegram-package","last_synced_at":"2026-05-24T21:31:31.894Z","repository":{"id":149017777,"uuid":"561053454","full_name":"obervinov/telegram-package","owner":"obervinov","description":"This module is designed to quickly initialize, authorize, and display various buttons/widgets for my telegram bots.","archived":false,"fork":false,"pushed_at":"2025-12-24T15:20:39.000Z","size":401,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T20:41:36.475Z","etag":null,"topics":["module","poetry","poetry-python","python-module","python3","telebot","telegram-bot"],"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":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-02T20:58:08.000Z","updated_at":"2025-12-24T15:19:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ee0b390-46df-4188-89a3-a09cea30f5dc","html_url":"https://github.com/obervinov/telegram-package","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/obervinov/telegram-package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obervinov","download_url":"https://codeload.github.com/obervinov/telegram-package/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obervinov%2Ftelegram-package/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33452032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["module","poetry","poetry-python","python-module","python3","telebot","telegram-bot"],"created_at":"2025-12-24T17:58:48.386Z","updated_at":"2026-05-24T21:31:31.889Z","avatar_url":"https://github.com/obervinov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Package\n[![Release](https://github.com/obervinov/telegram-package/actions/workflows/release.yaml/badge.svg)](https://github.com/obervinov/telegram-package/actions/workflows/release.yaml)\n[![CodeQL](https://github.com/obervinov/telegram-package/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/obervinov/telegram-package/actions/workflows/github-code-scanning/codeql)\n[![Tests and checks](https://github.com/obervinov/telegram-package/actions/workflows/pr.yaml/badge.svg)](https://github.com/obervinov/telegram-package/actions/workflows/pr.yaml)\n\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/obervinov/telegram-package?style=for-the-badge)\n![GitHub last commit](https://img.shields.io/github/last-commit/obervinov/telegram-package?style=for-the-badge)\n![GitHub Release Date](https://img.shields.io/github/release-date/obervinov/telegram-package?style=for-the-badge)\n![GitHub issues](https://img.shields.io/github/issues/obervinov/telegram-package?style=for-the-badge)\n![GitHub repo size](https://img.shields.io/github/repo-size/obervinov/telegram-package?style=for-the-badge)\n\n## \u003cimg src=\"https://github.com/obervinov/_templates/blob/main/icons/book.png\" width=\"25\" title=\"about\"\u003e About this project\nThis is an additional implementation compared to the **telebot** module.\n\nThis module is designed for quick initialization, authorization, rendering various _buttons/widgets_ and sending stylized messages for telegram-bots.\n\n\n## \u003cimg src=\"https://github.com/obervinov/_templates/blob/main/icons/requirements.png\" width=\"25\" title=\"functions\"\u003e Supported functions\n- Creating a connection to the telegram api and initializing the objects necessary for the bot to function (_parser_, _format_, _types_, _etc_)\n- Generating an inline keyboard button with a matrix of the specified size from the passed elements\n- Starting the bot polling process\n- Sending or editing a stylized message to a user\n- Deleting a message from chat\n- Interception of invoked exceptions\n\n\n## \u003cimg src=\"https://github.com/obervinov/_templates/blob/main/icons/requirements.png\" width=\"25\" title=\"functions\"\u003e Data structure in Vault\nThe structure of storing the bot token in the **Vault**\nConfiguration path: `${mount_point}/configuration/telegram`\n```json\n{\n    \"token\": \"1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n}\n```\n\n\nThe `policy` required by the module when interacting with **Vault**.\nAn example of a policy with all the necessary rights and a description can be found [here](tests/vault/policy.hcl).\n\n## \u003cimg src=\"https://github.com/obervinov/_templates/blob/main/icons/stack2.png\" width=\"20\" title=\"install\"\u003e Installing with Poetry\n```bash\ntee -a pyproject.toml \u003c\u003cEOF\n[tool.poetry]\nname = myproject\"\nversion = \"1.0.0\"\ndescription = \"\"\n\n[tool.poetry.dependencies]\npython = \"^3.12\"\ntelegram = { git = \"https://github.com/obervinov/telegram-package.git\", tag = \"v3.0.3\" }\n\n[build-system]\nrequires = [\"poetry-core\"]\nbuild-backend = \"poetry.core.masonry.api\"\nEOF\n\npoetry install\n```\n\n## \u003cimg src=\"https://github.com/obervinov/_templates/blob/main/icons/config.png\" width=\"25\" title=\"usage\"\u003e Usage example\n### Environment variables\n| Name  | Description | Default value |\n| ------------------- | ----------------- | ------ |\n| `TELEGRAM_BOT_NAME` | Telegram bot name | `None` |\n\n1. Create messages template file\n```bash\ntee -a configs/messages.json \u003c\u003cEOF\n{\n    \"templates\": {\n        \"test_message\": {\n            \"text\": \"Hi, \u003cb\u003e{0}\u003c/b\u003e! {1}\\nAccess for your account - allowed {2}\",\n            \"args\": [\"username\", \":raised_hand:\", \":unlocked:\"]\n        }\n    }\n}\n```\n\n- Simple usage\n    ```python\n    # import module\n    from telegram import TelegramBot\n\n    # init class objects\n    telegram = TelegramBot(vault_client)\n    bot = telegram.telegram_bot\n\n    # decorator\n    @bot.message_handler(commands=['start'])\n    def start_message(message):\n        telegram.send_styled_message(\n            message.chat.id,\n            messages_template={\n                'alias': 'hello_message',\n                'kwargs': {\n                    'username': message.from_user.first_name\n                }\n            }\n        )  \n    \n    # run bot pulling\n    telegram.launch_bot()\n    ```\n\n- With inline keyboard\n    ```python\n    # import module\n    from telegram import TelegramBot\n\n    # init class objects\n    telegram_bot = TelegramBot(vault_client).telegram_bot\n\n    # decorator\n    @telegram_bot.message_handler(commands=['start'])\n    def start_message(message):\n        markup = telegram_bot.telegram.create_inline_markup(\n            [\n                'Jan', 'Feb', 'Mar', 'Apr',\n                'May', 'June', 'July', 'Aug',\n                'Sept', 'Oct', 'Nov', 'Dec'\n            ],\n            4\n        )\n        telegram_bot.send_message(\n            message.chat.id,\n            f\"\\U0001F4C5 Select month for the creating report\",\n            reply_markup=markup\n        )\n\n    # run bot pulling\n    telegram.launch_bot()\n    ```\n    \u003cimg src=\"https://github.com/obervinov/telegram-package/blob/main/doc/inline_keyboard_example.png\" width=\"750\" title=\"inline_keyboard_example\"\u003e\n\n\n## \u003cimg src=\"https://github.com/obervinov/_templates/blob/main/icons/github-actions.png\" width=\"25\" title=\"github-actions\"\u003e GitHub Actions\n| Name  | Version |\n| ------------------------ | ----------- |\n| GitHub Actions Templates | [v2.1.1](https://github.com/obervinov/_templates/tree/v2.1.1) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobervinov%2Ftelegram-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobervinov%2Ftelegram-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobervinov%2Ftelegram-package/lists"}