From 562a3be05bb23229f59b61300a244685ac03027d Mon Sep 17 00:00:00 2001 From: apepenkov Date: Wed, 8 Nov 2023 18:47:50 +0300 Subject: [PATCH] remove asyncio boilerplate, mention python -m asyncio requirement --- README.rst | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 0707b924..2e8556b8 100755 --- a/README.rst +++ b/README.rst @@ -37,10 +37,12 @@ Installing Creating a client ----------------- + +Use ``python -m asyncio`` in order to run those examples + .. 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. @@ -48,12 +50,8 @@ Creating a client api_hash = '0123456789abcdef0123456789abcdef' - async def main(): - async with Client('session_name', api_id, api_hash) as client: - await client.interactive_login() - - - asyncio.run(main()) + async with Client('session_name', api_id, api_hash) as client: + await client.interactive_login() Doing stuff