如果我有错误,我该如何forward_name?
我在Python Telegram bot上写。我需要获取用户和他的ID的名称,他的信息通过单词命令回答。 我有一个代码,两个人交互,发件人的名称和ID正常显示,但问题是第二个不起作用。
bot.send_message(message.chat.id, "[{0.first_name}](tg://user?id={0.id}) killed [{1.first_name}](tg://user?id={1.id})
I write on the Python Telegram bot. And I need to get the name of the user and his id, whose message was answered with the word-command.
I have a code in which two people interact, the sender's name and id are displayed normally, but the problem is that the second does not work.
bot.send_message(message.chat.id, "[{0.first_name}](tg://user?id={0.id}) killed [{1.first_name}](tg://user?id={1.id}) ????".format(message.from_user, message.forward_from),
parse_mode='MarkdownV2')
And the console displays this error
AttributeError: 'NoneType' object has no attribute 'first_name'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论