tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Silent adding members to supergroup #2249

Closed KirillTurchinskii closed 1 year ago

KirillTurchinskii commented 1 year ago

When I execute CreateNewSupergroupChat -> add 2 people -> execute SendMessage from group owner account with two mentions in it -> execute SetChatMemberStatus to invite bot and give him admin rights at the same time -> bot writes his welcome message on invite.

After that, if you manually try to add members to the supergroup, then there will be no message that someone has been added (a person will be added, but this can only be understood by the number and list of members)

But if, after the actions described above, wait 10 minutes, and then add a member, then when adding, messages will begin to appear again that someone has added someone.

How can this 10 minute silence window be avoided, can it be narrowed down, or can a bot or admin user see these invisible add messages?

levlam commented 1 year ago

The behavior can't be avoided. It is up to the server when to send service messages and whether to send them at all. Service messages are just messages, nothing more. There is nothing like "invisible add messages". If you want to listen for updates about chat members, you need to process "chat_member" updates: https://core.telegram.org/bots/api#update.

KirillTurchinskii commented 1 year ago

Thank you. It worked.