Update signing-in.rst

Without await for TelegramClient running code returns `RuntimeWarning: coroutine 'AuthMethods._start' was never awaited`
This commit is contained in:
Vitalik Esipov 2022-03-01 11:44:41 +03:00 committed by GitHub
parent c47a9346e1
commit ebc68d5d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ We can finally write some code to log into our account!
async def main(): async def main():
# The first parameter is the .session file name (absolute paths allowed) # The first parameter is the .session file name (absolute paths allowed)
async with TelegramClient('anon', api_id, api_hash).start() as client: async with await TelegramClient('anon', api_id, api_hash).start() as client:
await client.send_message('me', 'Hello, myself!') await client.send_message('me', 'Hello, myself!')
asyncio.run(main()) asyncio.run(main())