因此,当从其他用户向机器人转发消息时,机器人应获得原始的转发发件人姓名
我在文档中尝试过:
reply_to_id = message.forward_sender_name
但是我得到了这个错误:
'Message' object has no attribute 'forward_sender_name'
我可以从转发的邮件中获取用户的原始名字吗?
我正在使用 python 3.7 pytelegrambotapi
答案 0 :(得分:0)
您将阅读Telegram Bot API文档。在pyTelegramBotAPI中,使用forward_from
代替message.forward_sender_name
。
reply_to_id = message.forward_from.first_name + messge.forward_from.last_name