Telegram.Bot
Telegram.Bot copied to clipboard
Add chat-specific overloads for PromoteChatMemberAsync
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
);
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.
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.