1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

add BotCommandScope helper extensions

This commit is contained in:
InsanusMokrassar 2022-05-01 17:18:44 +06:00
parent 92b4ba2ff0
commit 87fff2e5d0

View File

@ -51,6 +51,16 @@ private class SurrogateBotCommandScope(
@Serializable(BotCommandScopeSerializer::class) @Serializable(BotCommandScopeSerializer::class)
sealed interface BotCommandScope { sealed interface BotCommandScope {
val type: String 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 @Serializable