From 87fff2e5d094e86ff69687bb4d420c66b10e64f3 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 1 May 2022 17:18:44 +0600 Subject: [PATCH] add BotCommandScope helper extensions --- .../inmo/tgbotapi/types/commands/BotCommandScope.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/commands/BotCommandScope.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/commands/BotCommandScope.kt index 681a1c6baa..ce1aa93bee 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/commands/BotCommandScope.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/commands/BotCommandScope.kt @@ -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