Telethon/readthedocs/index.rst

126 lines
3.0 KiB
ReStructuredText
Raw Normal View History

2019-05-09 13:24:37 +03:00
========================
Telethon's Documentation
========================
2017-11-19 19:56:05 +03:00
2019-05-09 13:24:37 +03:00
.. code-block:: python
2017-11-19 19:56:05 +03:00
2021-09-11 15:05:24 +03:00
import asyncio
from telethon import TelegramClient, events
2017-11-19 19:56:05 +03:00
2021-09-11 15:05:24 +03:00
async def main():
async with TelegramClient('name', api_id, api_hash) as client:
await client.send_message('me', 'Hello, myself!')
print(await client.download_profile_photo('me'))
2021-09-11 15:05:24 +03:00
@client.on(events.NewMessage(pattern='(?i).*Hello'))
async def handler(event):
await event.reply('Hey!')
2017-11-19 19:56:05 +03:00
2021-09-11 15:05:24 +03:00
await client.run_until_disconnected()
asyncio.run(main())
2019-05-09 13:24:37 +03:00
* Are you new here? Jump straight into :ref:`installation`!
* Looking for the method reference? See :ref:`client-ref`.
* Did you upgrade the library? Please read :ref:`changelog`.
* Used Telethon before v1.0? See :ref:`compatibility-and-convenience`.
* Coming from Bot API or want to create new bots? See :ref:`botapi`.
2019-05-22 12:29:46 +03:00
* Need the full API reference? https://tl.telethon.dev/.
2018-01-09 20:04:51 +03:00
What is this?
2019-05-09 13:24:37 +03:00
-------------
2018-01-09 20:04:51 +03:00
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.
2019-05-09 13:24:37 +03:00
How should I use the documentation?
-----------------------------------
2017-11-20 07:12:31 +03:00
2019-05-09 13:24:37 +03:00
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.
2017-11-19 19:56:05 +03:00
2019-05-09 13:24:37 +03:00
You can also use the menu on the left to quickly skip over sections.
2017-11-19 19:56:05 +03:00
.. toctree::
2019-05-09 13:24:37 +03:00
:hidden:
:caption: First Steps
2017-11-19 19:56:05 +03:00
2019-05-09 13:24:37 +03:00
basic/installation
basic/signing-in
basic/quick-start
basic/updates
basic/next-steps
.. toctree::
2019-05-09 13:24:37 +03:00
:hidden:
:caption: Quick References
2017-11-20 07:12:31 +03:00
2019-05-09 13:24:37 +03:00
quick-references/faq
quick-references/client-reference
quick-references/events-reference
quick-references/objects-reference
2017-11-19 19:56:05 +03:00
.. toctree::
2019-05-09 13:24:37 +03:00
:hidden:
:caption: Concepts
2017-11-20 07:12:31 +03:00
2019-05-09 13:24:37 +03:00
concepts/strings
concepts/entities
concepts/chats-vs-channels
2019-05-09 13:24:37 +03:00
concepts/updates
concepts/sessions
concepts/full-api
concepts/errors
concepts/botapi-vs-mtproto
2019-05-09 13:24:37 +03:00
concepts/asyncio
.. toctree::
2019-05-09 13:24:37 +03:00
:hidden:
:caption: Full API Examples
2019-05-09 13:24:37 +03:00
examples/word-of-warning
examples/chats-and-channels
examples/users
examples/working-with-messages
.. toctree::
2019-05-09 13:24:37 +03:00
:hidden:
:caption: Developing
2019-05-09 13:24:37 +03:00
developing/philosophy.rst
developing/test-servers.rst
developing/project-structure.rst
developing/coding-style.rst
2019-12-08 01:41:02 +03:00
developing/testing.rst
2019-05-09 13:24:37 +03:00
developing/understanding-the-type-language.rst
developing/tips-for-porting-the-project.rst
developing/telegram-api-in-other-languages.rst
2017-11-20 07:12:31 +03:00
.. toctree::
2019-05-09 13:24:37 +03:00
:hidden:
:caption: Miscellaneous
2017-11-19 19:56:05 +03:00
2019-05-09 13:24:37 +03:00
misc/changelog
2021-09-11 13:00:28 +03:00
misc/v2-migration-guide.rst
2019-05-09 13:24:37 +03:00
misc/wall-of-shame.rst
misc/compatibility-and-convenience
2017-11-19 19:56:05 +03:00
2019-05-09 13:24:37 +03:00
.. toctree::
:hidden:
:caption: Telethon Modules
modules/client
modules/events
modules/custom
modules/utils
modules/errors
modules/sessions
modules/network
modules/helpers