Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Telethon: how to get information about yourself correctly?

$
0
0

I want to write my own client for the Telegram messenger in Python. I use the Telethon library. I took the code example from their main page:

 from telethon import TelegramClient api_id = my_id api_hash = 'my_hash' client = TelegramClient('Test2Session', api_id, api_hash) client.start() print(client.get_me().stringify())

This code should output information about me to the console. When I run this code I get the error:

 AttributeError: 'coroutine' object has no attribute 'stringify'

in line

 print(client.get_me().stringify())

How to fix this error? How to receive information about yourself?


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>