eternnoir / pyTelegramBotAPI

Python Telegram bot api.
GNU General Public License v2.0
8.11k stars 2.03k forks source link

'Message' object has no attribute 'forward_sender_name' #727

Closed jacopotediosi closed 4 years ago

jacopotediosi commented 4 years ago

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using? pyTelegramBotAPI==3.6.6

  2. What OS are you using? Debian 9

  3. What version of python are you using? Python 3.5.3

Starting from Telegram Bot API 4.2 (April 14, 2019, https://core.telegram.org/bots/api#april-14-2019), there is a new field of the Message Object called "forward_sender_name". pyTelegramBotAPI seems to don't support this yet, because I can see the field inside message.reply_to_message.json.forward_sender_name, but not directly inside the message object.

meoww-bot commented 4 years ago

maybe because the sender set the privacy - Forwarded messages - nobody ? or forward_sender_name only in forwarded message ?

jacopotediosi commented 4 years ago

maybe because the sender set the privacy - Forwarded messages - nobody ? or forward_sender_name only in forwarded message ?

I know what the "forward_sender_name" field is for. The issue is that it isn't supported by pyTelegramBotAPI yet. The field is visibile via message.reply_to_message.json.forward_sender_name, but not directly from the message object.

Badiboy commented 4 years ago

Starting from Telegram Bot API 4.2 (April 14, 2019)

Bot is a bit outdated in supporting BOT Api updates (fragmentary support for last two years). Will be improved... once.

coder2020official commented 4 years ago

i also had this when makiing feedback bot because privacy is on thats why it doesn't work

jacopotediosi commented 4 years ago

i also had this when makiing feedback bot because privacy is on thats why it doesn't work

When privacy mode is enabled on the sender user, Telegram adds a field called "forward_sender_name". This issue is here to report that this bot framework does not support this field because it is not updated to the Telegram API >= 4.2. This is clearly a problem of this repository and not a "desired behavior" nor a Telegram Fault.

Badiboy commented 4 years ago

Added long ago: https://github.com/eternnoir/pyTelegramBotAPI/pull/958 But not published in release. Use master branch: pip3 install git+https://github.com/eternnoir/pyTelegramBotAPI.git#egg=pyTelegramBotAPI