Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
2 contributors

Users who have contributed to this file

@Lonami @jeffffc
120 lines (91 sloc) 2.88 KB

Telethon's Documentation

from telethon.sync import TelegramClient, events

with TelegramClient('name', api_id, api_hash) as client:
   client.send_message('me', 'Hello, myself!')
   print(client.download_profile_photo('me'))

   @client.on(events.NewMessage(pattern='(?i).*Hello'))
   async def handler(event):
      await event.reply('Hey!')

   client.run_until_disconnected()

What is this?

Telegram is a popular messaging application. This library is meant to make it easy for you to write Python programs that can interact with Telegram. Think of it as a wrapper that has already done the heavy job for you, so you can focus on developing an application.

How should I use the documentation?

If you are getting started with the library, you should follow the documentation in order by pressing the "Next" button at the bottom-right of every page.

You can also use the menu on the left to quickly skip over sections.

.. toctree::
    :hidden:
    :caption: First Steps

    basic/installation
    basic/signing-in
    basic/quick-start
    basic/updates
    basic/next-steps

.. toctree::
    :hidden:
    :caption: Quick References

    quick-references/faq
    quick-references/client-reference
    quick-references/events-reference
    quick-references/objects-reference

.. toctree::
    :hidden:
    :caption: Concepts

    concepts/strings
    concepts/entities
    concepts/updates
    concepts/sessions
    concepts/full-api
    concepts/errors
    concepts/botapi-vs-mtproto
    concepts/asyncio

.. toctree::
    :hidden:
    :caption: Full API Examples

    examples/word-of-warning
    examples/chats-and-channels
    examples/users
    examples/working-with-messages
    examples/projects-using-telethon

.. toctree::
    :hidden:
    :caption: Developing

    developing/philosophy.rst
    developing/test-servers.rst
    developing/project-structure.rst
    developing/coding-style.rst
    developing/understanding-the-type-language.rst
    developing/tips-for-porting-the-project.rst
    developing/telegram-api-in-other-languages.rst

.. toctree::
    :hidden:
    :caption: Miscellaneous

    misc/changelog
    misc/wall-of-shame.rst
    misc/compatibility-and-convenience

.. toctree::
    :hidden:
    :caption: Telethon Modules

    modules/client
    modules/events
    modules/custom
    modules/utils
    modules/errors
    modules/sessions
    modules/network
    modules/helpers
You can’t perform that action at this time.