mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-14 01:52:21 +03:00
remove asyncio boilerplate, mention python -m asyncio requirement
This commit is contained in:
parent
ce2367b238
commit
562a3be05b
12
README.rst
12
README.rst
|
@ -37,10 +37,12 @@ Installing
|
||||||
Creating a client
|
Creating a client
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
|
||||||
|
Use ``python -m asyncio`` in order to run those examples
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from telethon import Client, events
|
from telethon import Client, events
|
||||||
import asyncio
|
|
||||||
|
|
||||||
# These example values won't work. You must get your own api_id and
|
# These example values won't work. You must get your own api_id and
|
||||||
# api_hash from https://my.telegram.org, under API Development.
|
# api_hash from https://my.telegram.org, under API Development.
|
||||||
|
@ -48,12 +50,8 @@ Creating a client
|
||||||
api_hash = '0123456789abcdef0123456789abcdef'
|
api_hash = '0123456789abcdef0123456789abcdef'
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async with Client('session_name', api_id, api_hash) as client:
|
||||||
async with Client('session_name', api_id, api_hash) as client:
|
await client.interactive_login()
|
||||||
await client.interactive_login()
|
|
||||||
|
|
||||||
|
|
||||||
asyncio.run(main())
|
|
||||||
|
|
||||||
|
|
||||||
Doing stuff
|
Doing stuff
|
||||||
|
|
Loading…
Reference in New Issue
Block a user