File: client.rst

package info (click to toggle)
python-telethon 1.40.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,508 kB
  • sloc: python: 16,125; javascript: 200; makefile: 16; sh: 11
file content (103 lines) | stat: -rw-r--r-- 2,328 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.. _telethon-client:

==============
TelegramClient
==============

.. currentmodule:: telethon.client

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.

**In short, to create a client you must run:**

.. code-block:: python

    from telethon import TelegramClient

    client = TelegramClient(name, api_id, api_hash)

    async def main():
        # Now you can use all client methods listed below, like for example...
        await client.send_message('me', 'Hello to myself!')

    with client:
        client.loop.run_until_complete(main())


You **don't** need to import these `AuthMethods`, `MessageMethods`, etc.
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:

.. automodule:: telethon.client.telegrambaseclient
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.account
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.auth
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.bots
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.buttons
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.chats
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.dialogs
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.downloads
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.messageparse
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.messages
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.updates
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.uploads
    :members:
    :undoc-members:
    :show-inheritance:

.. automodule:: telethon.client.users
    :members:
    :undoc-members:
    :show-inheritance: