簡體   English   中英

我如何獲取轉發器消息名稱 python pytelegrambotapi

[英]How can i get forwarder message name python pytelegrambotapi

因此,當從另一個用戶向機器人轉發消息時,機器人應該獲取原始轉發發件人名稱

我在文檔中嘗試過:

reply_to_id = message.forward_sender_name

但我收到此錯誤: 'Message' object has no attribute 'forward_sender_name'

我可以從轉發的消息中獲取用戶的原始名字嗎?

我正在使用python 3.7 pytelegrambotapi

您可以閱讀 Telegram Bot API 文檔。 在 pyTelegramBotAPI 中使用forward_from而不是message.forward_sender_name

reply_to_id = message.forward_from.first_name + messge.forward_from.last_name

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM