1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-12-04 21:35:44 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
682f696866 fill changelog 2022-05-01 17:23:12 +06:00
87fff2e5d0 add BotCommandScope helper extensions 2022-05-01 17:18:44 +06:00
2 changed files with 11 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
* `Core`:
* Add `BotCommandScopeChat` as new `BotCommandScope` (fix of [#574](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/574))
* `BotCommandScope` companion got several properties and functions for more useful scope creation
## 0.38.16

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