add BotCommandScope helper extensions

This commit is contained in:
InsanusMokrassar 2022-05-01 17:18:44 +06:00
parent 92b4ba2ff0
commit 87fff2e5d0
1 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,16 @@ private class SurrogateBotCommandScope(
@Serializable(BotCommandScopeSerializer::class)
sealed interface BotCommandScope {
val type: String
companion object {
val Default = BotCommandScopeDefault
val AllPrivateChats = BotCommandScopeAllPrivateChats
val AllGroupChats = BotCommandScopeAllGroupChats
val AllChatAdministrators = BotCommandScopeAllChatAdministrators
fun ChatAdministrators(chatId: ChatIdentifier) = BotCommandScopeChatAdministrators(chatId)
fun Chat(chatId: ChatIdentifier) = BotCommandScopeChat(chatId)
fun ChatMember(chatId: ChatIdentifier, userId: UserId) = BotCommandScopeChatMember(chatId, userId)
}
}
@Serializable