mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-04-21 01:21:59 +03:00
udpate readme to have functional 'Creating a client' section
This commit is contained in:
parent
a38c555994
commit
ce2367b238
10
README.rst
10
README.rst
|
@ -40,14 +40,20 @@ Creating a client
|
|||
.. code-block:: python
|
||||
|
||||
from telethon import Client, events
|
||||
import asyncio
|
||||
|
||||
# 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_id = 12345
|
||||
api_hash = '0123456789abcdef0123456789abcdef'
|
||||
|
||||
async with Client('session_name', api_id, api_hash) as client:
|
||||
await client.interactive_login()
|
||||
|
||||
async def main():
|
||||
async with Client('session_name', api_id, api_hash) as client:
|
||||
await client.interactive_login()
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
|
||||
|
||||
Doing stuff
|
||||
|
|
Loading…
Reference in New Issue
Block a user