{"id":13461708,"url":"https://github.com/LonamiWebs/Telethon","last_synced_at":"2025-03-24T22:34:55.144Z","repository":{"id":37401148,"uuid":"66641037","full_name":"LonamiWebs/Telethon","owner":"LonamiWebs","description":"Pure Python 3 MTProto API Telegram client library, for bots too!","archived":false,"fork":false,"pushed_at":"2024-11-06T15:23:33.000Z","size":9570,"stargazers_count":9993,"open_issues_count":71,"forks_count":1403,"subscribers_count":155,"default_branch":"v1","last_synced_at":"2024-11-12T09:17:05.583Z","etag":null,"topics":["hacktoberfest","library","mtproto","python-library","telegram","telegram-api","telethon"],"latest_commit_sha":null,"homepage":"https://docs.telethon.dev","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/LonamiWebs.png","metadata":{"files":{"readme":"README.rst","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":"2016-08-26T10:59:24.000Z","updated_at":"2024-11-12T09:07:25.000Z","dependencies_parsed_at":"2022-07-12T15:18:10.881Z","dependency_job_id":"3a77b08a-882b-44f0-af46-5b1b177308ea","html_url":"https://github.com/LonamiWebs/Telethon","commit_stats":{"total_commits":2890,"total_committers":162,"mean_commits":"17.839506172839506","dds":"0.12595155709342565","last_synced_commit":"9aad453e1ad219dc3942646c741c4a02ca8ce8ea"},"previous_names":[],"tags_count":171,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LonamiWebs%2FTelethon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LonamiWebs%2FTelethon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LonamiWebs%2FTelethon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LonamiWebs%2FTelethon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LonamiWebs","download_url":"https://codeload.github.com/LonamiWebs/Telethon/tar.gz/refs/heads/v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245366204,"owners_count":20603438,"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":["hacktoberfest","library","mtproto","python-library","telegram","telegram-api","telethon"],"created_at":"2024-07-31T11:00:53.713Z","updated_at":"2025-03-24T22:34:50.121Z","avatar_url":"https://github.com/LonamiWebs.png","language":"Python","readme":"Telethon\n========\n.. epigraph::\n\n  ⭐️ Thanks **everyone** who has starred the project, it means a lot!\n\n|logo| **Telethon** is an asyncio_ **Python 3**\nMTProto_ library to interact with Telegram_'s API\nas a user or through a bot account (bot API alternative).\n\n.. important::\n\n    If you have code using Telethon before its 1.0 version, you must\n    read `Compatibility and Convenience`_ to learn how to migrate.\n    As with any third-party library for Telegram, be careful not to\n    break `Telegram's ToS`_ or `Telegram can ban the account`_.\n\nWhat is this?\n-------------\n\nTelegram is a popular messaging application. This library is meant\nto make it easy for you to write Python programs that can interact\nwith Telegram. Think of it as a wrapper that has already done the\nheavy job for you, so you can focus on developing an application.\n\n\nInstalling\n----------\n\n.. code-block:: sh\n\n  pip3 install telethon\n\n\nCreating a client\n-----------------\n\n.. code-block:: python\n\n    from telethon import TelegramClient, events, sync\n\n    # These example values won't work. You must get your own api_id and\n    # api_hash from https://my.telegram.org, under API Development.\n    api_id = 12345\n    api_hash = '0123456789abcdef0123456789abcdef'\n\n    client = TelegramClient('session_name', api_id, api_hash)\n    client.start()\n\n\nDoing stuff\n-----------\n\n.. code-block:: python\n\n    print(client.get_me().stringify())\n\n    client.send_message('username', 'Hello! Talking to you from Telethon')\n    client.send_file('username', '/home/myself/Pictures/holidays.jpg')\n\n    client.download_profile_photo('me')\n    messages = client.get_messages('username')\n    messages[0].download_media()\n\n    @client.on(events.NewMessage(pattern='(?i)hi|hello'))\n    async def handler(event):\n        await event.respond('Hey!')\n\n\nNext steps\n----------\n\nDo you like how Telethon looks? Check out `Read The Docs`_ for a more\nin-depth explanation, with examples, troubleshooting issues, and more\nuseful information.\n\n.. _asyncio: https://docs.python.org/3/library/asyncio.html\n.. _MTProto: https://core.telegram.org/mtproto\n.. _Telegram: https://telegram.org\n.. _Compatibility and Convenience: https://docs.telethon.dev/en/stable/misc/compatibility-and-convenience.html\n.. _Telegram's ToS: https://core.telegram.org/api/terms\n.. _Telegram can ban the account: https://docs.telethon.dev/en/stable/quick-references/faq.html#my-account-was-deleted-limited-when-using-the-library\n.. _Read The Docs: https://docs.telethon.dev\n\n.. |logo| image:: logo.svg\n    :width: 24pt\n    :height: 24pt\n","funding_links":[],"categories":["MTProto implementations","Python","Career Path","网络服务","Bots","Third-party Web APIs","📚 فهرست","[↑](#contents) Tools"],"sub_categories":["Community","网络服务_其他","Bot Libs","ساخت بات تلگرام"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLonamiWebs%2FTelethon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLonamiWebs%2FTelethon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLonamiWebs%2FTelethon/lists"}