Description
Environment:
tdl
: v7.2.0tdl-tdlib-addon
: v1.2.2prebuilt-tdlib
: v0.1008012.0- Node.js: v20
- OS: GNU/Linux
Summary:
When using TDLib in a private channel where a bot is present as an admin, the event updateDeleteMessages
is not emitted immediately after a user deletes a message via the official Telegram app.
Instead, the update is delayed and only emitted after another message is sent or edited in the same channel. This makes it difficult to detect deletions in near real-time.
Steps to Reproduce:
- Add a bot using TDLib to a private channel, with full admin rights.
- Delete a message in the channel using the Telegram mobile/desktop client.
- No
updateDeleteMessages
event is received immediately. - Send or edit a message in the channel.
- The
updateDeleteMessages
event is now emitted for the earlier deletion.
Expected behavior:
updateDeleteMessages
should be emitted immediately when a message is deleted, even if no other chat activity occurs.
Observed behavior:
TDLib appears to buffer or hold the updateDeleteMessages
update until another state-changing event (like a message or reaction) triggers an update propagation.
Notes:
- The bot is using TDLib via the Node.js
tdl
wrapper. - The issue happens across all private channels where the bot is added.
- Periodic polling via methods like
getAuthorizationState
does not unblock the update. - Reacting to messages triggers the flush only if the reaction causes a visible change (e.g. first time adding a like).
- It seems that TDLib does not propagate the deletion unless a concurrent "chat state change" occurs.
Please let me know if more logs, debug traces, or configuration details are needed.
I'd be happy to test any patches or experimental flags.
Thank you for maintaining TDLib — it's an amazing foundation for Telegram bots.