mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
Merge pull request #195 from madhead/issues/184
Fix #184: Anonymous Admins: support for is_anonymous flag
This commit is contained in:
commit
ec806dfd83
@ -41,6 +41,8 @@
|
||||
* `LocationContent#createResend` now can create `LiveLocation`
|
||||
* Support of `ProximityAlertTriggered`. It is `CommonEvent`
|
||||
* Property `pollQuestionTextLength` now have maximum up to `300`
|
||||
* Anonymous Admins:
|
||||
* New field `AdministratorChatMember#isAnonymous`
|
||||
* `API`:
|
||||
* Extensions `TelegramBot#pinChatMessage` now support any `Chat` and `Message`s from any `Chat`
|
||||
* New extensions `TelegramBot#unpinAllChatMessages`
|
||||
|
@ -14,5 +14,6 @@ data class AdministratorChatMemberImpl(
|
||||
override val canRestrictMembers: Boolean,
|
||||
override val canPinMessages: Boolean,
|
||||
override val canPromoteMembers: Boolean,
|
||||
override val isAnonymous: Boolean,
|
||||
override val customTitle: String?
|
||||
) : AdministratorChatMember
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.User
|
||||
|
||||
data class CreatorChatMember(
|
||||
override val user: User,
|
||||
override val isAnonymous: Boolean,
|
||||
override val customTitle: String?
|
||||
) : AdministratorChatMember {
|
||||
override val canBeEdited: Boolean = true
|
||||
|
@ -40,12 +40,14 @@ internal data class RawChatMember(
|
||||
private val canSendOtherMessages: Boolean = false,
|
||||
@SerialName(canAddWebPagePreviewsField)
|
||||
private val canAddWebPagePreviews: Boolean = false,
|
||||
@SerialName(isAnonymousField)
|
||||
private val isAnonymous: Boolean = false,
|
||||
@SerialName(customTitleField)
|
||||
private val customTitle: String? = null
|
||||
) {
|
||||
val asChatMember: ChatMember by lazy {
|
||||
when (status) {
|
||||
"creator" -> CreatorChatMember(user, customTitle)
|
||||
"creator" -> CreatorChatMember(user, isAnonymous, customTitle)
|
||||
"administrator" -> AdministratorChatMemberImpl(
|
||||
user,
|
||||
canBeEdited,
|
||||
@ -57,6 +59,7 @@ internal data class RawChatMember(
|
||||
canRestrictMembers,
|
||||
canPinMessages,
|
||||
canPromoteMembers,
|
||||
isAnonymous,
|
||||
customTitle
|
||||
)
|
||||
"member" -> MemberChatMember(user)
|
||||
|
@ -7,5 +7,6 @@ interface AdministratorChatMember : SpecialRightsChatMember {
|
||||
val canRemoveMessages: Boolean
|
||||
val canRestrictMembers: Boolean
|
||||
val canPromoteMembers: Boolean
|
||||
val isAnonymous: Boolean
|
||||
val customTitle: String?
|
||||
}
|
Loading…
Reference in New Issue
Block a user