Upon trying following code on Telethon 1.11.3 , python 3.7.3
from telethon import TelegramClient
api_id = xxx #i give my id
api_hash = xxx##i give my
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())
I get error as RuntimeError: You must use "async with" if the event loop is running (i.e. you are inside an "async def")