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

Easier way to determine if current user is a chat admin than via searchChatMembers ? #2996

Closed Flohack74 closed 3 months ago

Flohack74 commented 3 months ago

Hi there,

I I want, lets say, determine if a user can ban a user and delete messages I would need to call searchChatMembers for that particular user every time I enter a chat, with the right query and filter set. And then walk down chatMember->status->chatMemberStatusAdministrator->rights->can_delete_messages|can_restrict_members or of course its chatMember->status->chatMemberStatusCreator

That sounds complex, is there a better way to do this?

levlam commented 3 months ago

There is no. You need to check user rights in chat member status.