tdlib / telegram-bot-api

Telegram Bot API server
https://core.telegram.org/bots
Boost Software License 1.0
3.08k stars 586 forks source link

Send updates for deleted messages #286

Open rayanbzd opened 2 years ago

rayanbzd commented 2 years ago

Would it be possible to send updates when a message is deleted ? Just like when messages are edited.

levlam commented 2 years ago

This is not possible to implement right now, but may become possible in the future.

isage commented 1 year ago

Are there any updates on this?

Use case: we need to display 5 last posts from our tg channel on website. Rn it's implemented as webhook receiving new messages and storing their id's, then we use widget api with those ids. Problem is, sometimes editors remove posts from tg channel and re-post them, but we have no way of knowing that. So we display "doubles" on website (that's another question, though, why is there two messages with different id, and despite one being deleted widget api still happily shows it). Even without doubles, displaying "this post doesn't exist" is a no-go for us.

levlam commented 1 year ago

@isage Could you send a link to the website, which shows the "doubles"?

isage commented 1 year ago

I made a test-page https://muztube.ru/test.html

isage commented 1 year ago

oh. it looks like for post with pictures there's new message event for EACH pictuure in post with different id's

levlam commented 1 year ago

The first link is for the second photo in a media album and the second link is for the first photo in the same media album. Widget by default shows all photos in the album. You can use link in the form https://t.me/<username>/<message_id>?single to show specific media or show only one post for each media album.

isage commented 1 year ago

(it out of scope of that issue, but how would i differentiate between them to show only one post with both pictures instead?)

levlam commented 1 year ago

Message object in Bot API has media_group_id field.

rebelcode-xr commented 1 year ago

very important feature to have: we want to be able to fully manage a channel from our website, but if an editor deletes a post, we have no way to keep the web db in sync. Please implement this asap 🙏

Are there any updates on this?

Use case: we need to display 5 last posts from our tg channel on website. Rn it's implemented as webhook receiving new messages and storing their id's, then we use widget api with those ids. Problem is, sometimes editors remove posts from tg channel and re-post them, but we have no way of knowing that. So we display "doubles" on website (that's another question, though, why is there two messages with different id, and despite one being deleted widget api still happily shows it). Even without doubles, displaying "this post doesn't exist" is a no-go for us.

AYMENJD commented 1 year ago

@rebelcode-xr You can't by this feature. its not guaranteed to receive update about deleted messages in real-time for channels and groups and maybe private chats too.

rebelcode-xr commented 1 year ago

@rebelcode-xr You can't by this feature. its not guaranteed to receive update about deleted messages in real-time for channels and groups and maybe private chats too.

What do you mean? This feature doesn't exists yet.

AYMENJD commented 1 year ago

@rebelcode-xr it's exists but not for bots. Allowing bots to receive it will produce the above behavior.

rebelcode-xr commented 1 year ago

https://bugs.telegram.org/c/735

tigco commented 1 year ago

I need this too

sohamdeogaonkar commented 7 months ago

+1 I want this features

I just want to know what's the problem for not adding it. https://bugs.telegram.org/c/735 This feature has been requested more than 3 years ago It has 165+ upvotes on bug platform Almost issue about this case on almost every library for Telegram bots

We can get the update of edited messages What's makes the problem with delete messages I thinks it ultimately based on mtproto It has feature about that So what's the problem adding on bot api