Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chat-specific overloads for PromoteChatMemberAsync #1060

Open
karb0f0s opened this issue Jan 28, 2022 · 2 comments
Open

Add chat-specific overloads for PromoteChatMemberAsync #1060

karb0f0s opened this issue Jan 28, 2022 · 2 comments

Comments

@karb0f0s
Copy link
Member

promoteChatMember method has subset of options, related only to specific chat types: can_pin_messages - ... supergroups only, can_edit_messages - ... channels only.
Maybe we can add overloaded methods with specific subset of options:

// Channel-specific overload
public Task PromoteChatMemberAsync(
            this ITelegramBotClient botClient,
            ChatId chatId,
            long userId,
            ChannelPermissions channelPermissions,
            CancellationToken cancellationToken = default
        );

// Supergroup-specific overload
public Task PromoteChatMemberAsync(
            this ITelegramBotClient botClient,
            ChatId chatId,
            long userId,
            SupoergroupPermissions supergrouplPermissions,
            CancellationToken cancellationToken = default
        );
@tuscen
Copy link
Member

tuscen commented Mar 1, 2022

This feature goes against our rule to stick to type hierarchy from the Bot API docs. In the docs ChatPermissions object doesn't have a hierarchy split between different types of chats so we shouldn't assume it.

@tuscen
Copy link
Member

tuscen commented Mar 1, 2022

Though we can ask Telegram to do the same thing as they did with ChatMember object, i.e. to split it officialy in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants