{"id":46360007,"url":"https://github.com/gleb-chipiga/aiotgbot","last_synced_at":"2026-03-05T01:02:17.616Z","repository":{"id":57409179,"uuid":"303412709","full_name":"gleb-chipiga/aiotgbot","owner":"gleb-chipiga","description":" Asynchronous library for Telegram bot API ","archived":false,"fork":false,"pushed_at":"2025-11-30T13:08:32.000Z","size":1195,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-22T01:44:11.237Z","etag":null,"topics":["asyncio","python","telegram"],"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/gleb-chipiga.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-12T14:11:19.000Z","updated_at":"2025-11-30T13:08:35.000Z","dependencies_parsed_at":"2024-01-03T16:45:02.483Z","dependency_job_id":"a9527373-d253-4eed-a61d-76e1fe9bee88","html_url":"https://github.com/gleb-chipiga/aiotgbot","commit_stats":{"total_commits":219,"total_committers":1,"mean_commits":219.0,"dds":0.0,"last_synced_commit":"53d05359b6e1282aaad9d04fd036f6ed97074578"},"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"purl":"pkg:github/gleb-chipiga/aiotgbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleb-chipiga%2Faiotgbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleb-chipiga%2Faiotgbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleb-chipiga%2Faiotgbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleb-chipiga%2Faiotgbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gleb-chipiga","download_url":"https://codeload.github.com/gleb-chipiga/aiotgbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleb-chipiga%2Faiotgbot/sbom","scorecard":{"id":429428,"data":{"date":"2025-08-11","repo":{"name":"github.com/gleb-chipiga/aiotgbot","commit":"a49bbc07d9adb3b02baaf837595be80b1dcab3b3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T02:58:27.170Z","repository_id":57409179,"created_at":"2025-08-19T02:58:27.170Z","updated_at":"2025-08-19T02:58:27.170Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30104218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T00:38:46.881Z","status":"ssl_error","status_checked_at":"2026-03-05T00:38:45.829Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["asyncio","python","telegram"],"created_at":"2026-03-05T01:02:17.171Z","updated_at":"2026-03-05T01:02:17.596Z","avatar_url":"https://github.com/gleb-chipiga.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Asynchronous library for Telegram bot API\n\n[![Latest PyPI package version](https://badge.fury.io/py/aiotgbot.svg)](https://pypi.org/project/aiotgbot)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/gleb-chipiga/aiotgbot/blob/master/LICENSE)\n[![Downloads](https://img.shields.io/pypi/dm/aiotgbot)](https://pypistats.org/packages/aiotgbot)\n\n## Key Features\n\n- Asyncio and [aiohttp](https://github.com/aio-libs/aiohttp) based\n- All [Telegram Bot API](https://core.telegram.org/bots/api) types and methods supported\n- Tracks Telegram Bot API 7.2 (released March 31, 2024)\n- Bot API rate limit support\n- Both long polling and webhooks supported\n- Fully type annotated ([PEP 484](https://www.python.org/dev/peps/pep-0484/))\n\n## Installation\n\naiotgbot is available on PyPI. Use pip to install it:\n\n```bash\npip install aiotgbot\n```\n\n## Requirements\n\n- Python 3.11–3.14\n- [aiohttp](https://github.com/aio-libs/aiohttp)\n- [aiojobs](https://github.com/aio-libs/aiojobs)\n- [msgspec](https://github.com/jcrist/msgspec)\n- [tenacity](https://github.com/jd/tenacity)\n- [frozenlist](https://github.com/aio-libs/frozenlist)\n- [aiofreqlimit](https://github.com/gleb-chipiga/aiofreqlimit)\n- [yarl](https://github.com/aio-libs/yarl)\n\n## Using aiotgbot\n\n```python\nfrom typing import AsyncIterator\n\nfrom aiotgbot import (\n    Bot,\n    BotUpdate,\n    BotUpdateKey,\n    HandlerTable,\n    PollBot,\n    PrivateChatFilter,\n    Runner,\n)\nfrom aiotgbot.storage_memory import MemoryStorage\n\nhandlers = HandlerTable()\n\n\n@handlers.message(filters=[PrivateChatFilter()])\nasync def reply_private_message(bot: Bot, update: BotUpdate) -\u003e None:\n    assert update.message is not None\n    name = (\n        f\"{update.message.chat.first_name} \"\n        f\"{update.message.chat.last_name}\"\n    )\n    update[\"greeting_count\"] = update.get(\"greeting_count\", 0) + 1\n    await bot.send_message(update.message.chat.id, f\"Hello, {name}!\")\n\n\nasync def run_context(runner: Runner) -\u003e AsyncIterator[None]:\n    storage = MemoryStorage()\n    await storage.connect()\n    handlers.freeze()\n    bot = PollBot(runner[\"token\"], handlers, storage)\n    await bot.start()\n\n    yield\n\n    await bot.stop()\n    await storage.close()\n\n\ndef main() -\u003e None:\n    runner = Runner(run_context)\n    runner[\"token\"] = \"some:token\"\n    runner.run()\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Upgrading to 0.18.0\n\n**New features:**\n\n- **BotUpdateKey** – a dedicated typed key object for items stored on `BotUpdate`.\n- `BotUpdate` exposes `get_typed(key)`, `set_typed(key, value)`, and `del_typed(key)` helpers for working with `BotUpdateKey` instances.\n- Each `BotUpdateKey` enforces runtime type checking via `isinstance()` so handlers only see the expected payload.\n\n`BotUpdate` remains a regular mutable mapping so filters and handlers can stash arbitrary helper objects between each other. To keep data structured, use `BotUpdateKey` which enforces types per slot:\n\n```python\nfrom dataclasses import dataclass\n\nfrom aiotgbot import BotUpdateKey\n\n\n@dataclass\nclass Session:\n    trace_id: str\n    retries: int\n\n\nsession_key = BotUpdateKey(\"session\", Session)\n\n\nasync def my_handler(bot: Bot, update: BotUpdate) -\u003e None:\n    if session_key.name not in update:\n        update.set_typed(session_key, Session(trace_id=\"abc\", retries=0))\n    session = update.get_typed(session_key)\n    ...\n```\n\n## Development\n\nWe use [Prek](https://github.com/DetachHead/prek) as a drop-in `pre-commit` replacement backed by `uv` so hook environments resolve quickly and reproducibly. Install it once and run the configured Ruff, `mypy --strict`, and Basedpyright checks via:\n\n```bash\nuv tool install prek\nprek install\nprek run --all-files\n```\n\n`prek run` reads `.pre-commit-config.yaml`, so you can still target a subset of hooks or files during local development.\n\n`mise.toml` at the repo root mirrors the common workflows, so you can rely on [mise](https://mise.jdx.dev/) instead of remembering the raw commands. Trust the config once via `mise trust mise.toml` and then run, for example:\n\n```bash\nmise run lint\nmise run mypy\nmise run basedpyright\nmise run test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgleb-chipiga%2Faiotgbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgleb-chipiga%2Faiotgbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgleb-chipiga%2Faiotgbot/lists"}