telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

Bot doesn't handle channel post editing action if message was send by that bot but edited via Telegram client

Open maxsiml opened this issue 5 years ago • 6 comments

I'm using python-telegram-bot lib and created an issue there (please refer to it get more context https://github.com/python-telegram-bot/python-telegram-bot/issues/2461) but turned out that it is an issue with API so I was suggested to recreate the issue here.

Option 1 (works fine):

  1. Send a message to a channel manually via Telegram client
  2. Edit this message via Telegram client
  3. Catch edited message with bot (boom, it works, we see logs)

Option 2 (doesn't work):

  1. Send a message to the same channel using bot (I use the same bot that I need to handle editing with)
  2. Edit this message via Telegram client
  3. Catch edited message with bot (doesn't work, no reaction at all)

Looks like when message was send by one user/bot and edited by another user/bot fails to handle this update.

At the same time if I send a message to a channel via Telegram client with one user (admin) and edit it with another admin (human via Telegram client, the same way) bot handles update correctly.

Option 3 (also works fine):

  1. Send a message to a channel manually via Telegram client
  2. Edit this message via Telegram client with the same user
  3. Catch edited message with bot (boom, it works, we see logs)
  4. Edit the same message with another user via Telegram client
  5. Works again

maxsiml avatar Apr 11 '21 11:04 maxsiml

It is impossible to know which admin edited the channel post. Only initial sender of channel messages is known, so bots receive all updates about edits of messages sent by other admins and only about them.

levlam avatar Apr 11 '21 21:04 levlam

I don't want to know who exactly edited a message. I just want to catch an update via bot api that message was edited (by anyone).

The problem is I don't get any update at all in bot if message was published by a bot and edited by user (channel's admin). But I do receive update ok in bot if message was initially created by a user (admin) and edited by the same or another human admin.

maxsiml avatar Apr 11 '21 22:04 maxsiml

There is no way to know whenter a channel post was edited by the bot or another admin. Only initial sender of channel messages is known, so bots receive all updates about edits of messages sent by other admins and only about them.

levlam avatar Apr 11 '21 23:04 levlam

Did you read my message? Looks like a very clear question about the exact case. Is it expected not to receive edit message update in this case (why?) or not?

Issue once again: bot doesn't receive edit message update if message was sent to a channel by bot (admin) and edited by human (admin)

According to what you wrote:

  1. I don't edit a message with bot
  2. I don't need to know who edits a message
  3. I don't need to know who is an original sender
  • If it is expected behavior then ok but the reason is appreciated. Do you mean only humans by "admins"? I suppose no, since bot is admin as well.

  • If it's not expected, why did you mentioned twice that bot doesn't care who edit a message and receive all edit updates? Because here is the case where bot doesn't receive an update.

maxsiml avatar Apr 12 '21 00:04 maxsiml

I wrote exact reason, why the updates aren't received.

The Bot API server decides, which updates about edited channel posts are sent. There is no way it can know whether a channel post was edited by the bot itself or another admin. This informations is unavailable to anyone, including bots. The only known thing is whether the bot is the initial sender of the channel post. Hence, bots receive all updates about edits of messages sent by other admins and don't receive updates about edits of messages sent by the bot.

levlam avatar Apr 12 '21 00:04 levlam

It's still not resolved. As a "delete post" update.

On1x avatar Jan 06 '22 17:01 On1x