我想使用 python-telegram-bot 在 Python 脚本中打印用户信息,参考this https://core.telegram.org/bots/api/#user page
但是当我打字时
print update.message.from
keyword .from
被识别为内部保留关键字,我收到无效语法错误。
我该如何解决?
Thanks.
正如中所解释的python-telegram-bot 代码 https://github.com/python-telegram-bot/python-telegram-bot/blob/61fe438a8be3d0c1780a43f2fae044dedbcbf54e/telegram/choseninlineresult.py#L30 and 文档 https://python-telegram-bot.readthedocs.io/en/stable/telegram.choseninlineresult.html itself:
- 在Python中
from
是保留字,使用from_user
反而。
So: print update.message.from_user
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)