{"id":20733764,"url":"https://github.com/pageton/pytdbot-sync","last_synced_at":"2025-12-24T03:20:55.981Z","repository":{"id":210480631,"uuid":"726664987","full_name":"pageton/pytdbot-sync","owner":"pageton","description":"Easy-to-use asynchronous TDLib wrapper for Python.","archived":false,"fork":false,"pushed_at":"2024-06-21T20:24:25.000Z","size":3027,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T00:48:43.350Z","etag":null,"topics":["bot","bot-api","library","mtproto","python","sync","tdlib","tdlib-python","telegram","telegram-api","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/pageton.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}},"created_at":"2023-12-03T02:18:31.000Z","updated_at":"2024-07-13T11:38:58.000Z","dependencies_parsed_at":"2024-01-14T16:55:08.943Z","dependency_job_id":"ed9c9b36-05c3-4183-9160-682e06c9211c","html_url":"https://github.com/pageton/pytdbot-sync","commit_stats":null,"previous_names":["dev-rio/pytdbot-sync","pageton/pytdbot-sync"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2Fpytdbot-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2Fpytdbot-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2Fpytdbot-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2Fpytdbot-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pageton","download_url":"https://codeload.github.com/pageton/pytdbot-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243019179,"owners_count":20222816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bot","bot-api","library","mtproto","python","sync","tdlib","tdlib-python","telegram","telegram-api","telegram-bot-api"],"created_at":"2024-11-17T05:26:58.790Z","updated_at":"2025-12-24T03:20:55.946Z","avatar_url":"https://github.com/pageton.png","language":"Python","readme":"# Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat\u0026logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.31-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month\u0026units=none\u0026left_color=grey\u0026right_color=brightgreen\u0026left_text=Downloads)](https://pepy.tech/project/pytdbot)\r\n\r\nPytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.  \r\n\r\n### Features\r\n- Easy, **Fast** and **Powerful**\r\n- Fully **asynchronous**\r\n- **Decorator** based update handler\r\n- **Bound** methods\r\n- Supports **userbots**, **Plugins**, [**Filters**](https://github.com/pytdbot/client/blob/ad33d05d3e48bc8842b3986613ad2d99480a1fa8/pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) functions and much more.\r\n\r\n\r\n### Requirements\r\n\r\n- Python 3.9+\r\n- Telegram [API key](https://my.telegram.org/apps)\r\n- [tdjson](https://github.com/tdlib/td#building)\r\n- [deepdiff](https://github.com/seperman/deepdiff)\r\n\r\n### Installation\r\n\u003e For better performance, it's recommended to install [orjson](https://github.com/ijl/orjson#install) or [ujson](https://github.com/ultrajson/ultrajson#ultrajson).\r\n\r\nYou can install Pytdbot using pip:\r\nTo install the development version from Github, use the following command:\r\n```bash\r\npip install git+https://github.com/dev-rio/pytdbot-sync.git\r\n```\r\n\r\n### Examples\r\nBasic example:\r\n```python\r\n\r\nfrom pytdbot_sync import Client, utils\r\nfrom pytdbot_sync.types import LogStreamFile, Update\r\n\r\nclient = Client(\r\n    api_id=0,  \r\n    api_hash=\"API_HASH\",  \r\n    database_encryption_key=\"1234echobot$\",\r\n    token=\"1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI\",  # Your bot token or phone number if you want to login as user\r\n    files_directory=\"BotDB\",  # Path where to store TDLib files\r\n    lib_path=\"/path/to/libtdjson.so\", # Path to TDjson shared library\r\n    td_log=LogStreamFile(\"tdlib.log\"),  # Set TDLib log file path\r\n    td_verbosity=2,  # TDLib verbosity level\r\n)\r\n\r\n\r\n@client.on_updateNewMessage()\r\ndef print_message(c: Client, message: Update):\r\n    print(message)\r\n\r\n\r\n@client.on_updateNewMessage()\r\ndef simple_message(c: Client, message: Update):\r\n    if message.is_private:\r\n        message.reply_text('Hi! i am simple bot')\r\n\r\n    if message.is_self and message.text: # Works only for userbots.\r\n        if message.text == \"!id\":\r\n            message.edit_text(\r\n                \"\\\\- Current chat ID: {}\\n\\\\- {} ID: {}\".format(\r\n                    utils.code(str(message.chat_id)),\r\n                    utils.bold(c.me[\"first_name\"]),\r\n                    utils.code(str(message.from_id)),\r\n                ),\r\n                parse_mode=\"markdownv2\",\r\n            )\r\n\r\n\r\n\r\n# Run the client\r\nclient.run()\r\n\r\n```\r\nFor more examples, check the [examples](https://github.com/dev-rio/pytdbot-sync/tree/main/examples) folder.\r\n\r\n# Thanks to\r\n- You for viewing or using this project.\r\n\r\n- [@levlam](https://github.com/levlam) for maintaining [TDLib](https://github.com/tdlib/td) and for the help to create [Pytdbot](https://github.com/pytdbot/client).\r\n# License\r\n\r\nMIT [License](https://github.com/pytdbot/client/blob/main/LICENSE)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageton%2Fpytdbot-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpageton%2Fpytdbot-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageton%2Fpytdbot-sync/lists"}