I would like to print user information in Python script using python-telegram-bot referring to this page
But when I type
print update.message.from
keyword .from
is recognized as internal reserved keyword and I get invalid syntax error.
How can I solve?
Thanks.
As explained in the python-telegram-bot code and documentation itself:
- In Python
from
is a reserved word, usefrom_user
instead.
So: print update.message.from_user
.