2018-06-19 22:24:26 +03:00
|
|
|
.. _telethon-client:
|
|
|
|
|
2019-05-09 13:24:37 +03:00
|
|
|
==============
|
|
|
|
TelegramClient
|
|
|
|
==============
|
2018-06-19 22:24:26 +03:00
|
|
|
|
2019-05-09 13:24:37 +03:00
|
|
|
.. currentmodule:: telethon.client
|
2018-06-19 22:24:26 +03:00
|
|
|
|
2019-05-09 13:24:37 +03:00
|
|
|
The `TelegramClient <telegramclient.TelegramClient>` aggregates several mixin
|
|
|
|
classes to provide all the common functionality in a nice, Pythonic interface.
|
|
|
|
Each mixin has its own methods, which you all can use.
|
2018-06-19 22:24:26 +03:00
|
|
|
|
|
|
|
**In short, to create a client you must run:**
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
from telethon import TelegramClient
|
|
|
|
|
2019-08-14 00:33:39 +03:00
|
|
|
client = TelegramClient(name, api_id, api_hash)
|
|
|
|
|
2018-06-19 22:24:26 +03:00
|
|
|
async def main():
|
|
|
|
# Now you can use all client methods listed below, like for example...
|
|
|
|
await client.send_message('me', 'Hello to myself!')
|
|
|
|
|
2019-08-14 00:33:39 +03:00
|
|
|
with client:
|
|
|
|
client.loop.run_until_complete(main())
|
2018-06-19 22:24:26 +03:00
|
|
|
|
|
|
|
|
|
|
|
You **don't** need to import these `AuthMethods`, `MessageMethods`, etc.
|
2019-05-09 13:24:37 +03:00
|
|
|
Together they are the `TelegramClient <telegramclient.TelegramClient>` and
|
|
|
|
you can access all of their methods.
|
|
|
|
|
|
|
|
See :ref:`client-ref` for a short summary.
|
|
|
|
|
|
|
|
.. automodule:: telethon.client.telegramclient
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
2018-06-19 22:24:26 +03:00
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.telegrambaseclient
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
2018-06-19 22:24:26 +03:00
|
|
|
|
2019-01-05 19:18:40 +03:00
|
|
|
.. automodule:: telethon.client.account
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-06-19 22:24:26 +03:00
|
|
|
.. automodule:: telethon.client.auth
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.bots
|
2018-06-19 22:24:26 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.buttons
|
2018-06-19 22:24:26 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.chats
|
2018-06-19 22:24:26 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.dialogs
|
2018-06-19 22:24:26 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.downloads
|
2018-06-19 22:24:26 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.messageparse
|
2018-06-22 15:44:59 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.messages
|
2018-06-19 22:24:26 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.updates
|
2018-06-19 22:24:26 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.uploads
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|
2018-06-19 22:24:26 +03:00
|
|
|
|
2018-10-28 12:21:03 +03:00
|
|
|
.. automodule:: telethon.client.users
|
2018-06-19 22:24:26 +03:00
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
:show-inheritance:
|