From 5175395be2a3285770e143d8029f8b92ac161ae7 Mon Sep 17 00:00:00 2001 From: McModder Date: Wed, 28 Aug 2024 16:34:55 +0300 Subject: [PATCH] Fix class comparison in ChatMember.isMemberStrict and ChatMember.isAdministratorStrict --- .../behaviour_builder/utils/extensions/ChatMember.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/extensions/ChatMember.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/extensions/ChatMember.kt index 8a13fcef5c..c193aa162a 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/extensions/ChatMember.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/extensions/ChatMember.kt @@ -14,11 +14,11 @@ val ChatMember.isAdministrator: Boolean get() = this is AdministratorChatMember /** * Checks if member is strictly [MemberChatMember], not any derivatives */ -val ChatMember.isMemberStrict: Boolean get() = this::class == MemberChatMemberImpl::class +val ChatMember.isMemberStrict: Boolean get() = this is MemberChatMemberImpl /** * Checks if member is strictly [AdministratorChatMember], not any derivatives */ -val ChatMember.isAdministratorStrict: Boolean get() = this::class == AdministratorChatMemberImpl::class +val ChatMember.isAdministratorStrict: Boolean get() = this is AdministratorChatMemberImpl val ChatMember.hasSpecialRights: Boolean get() = this is SpecialRightsChatMember val ChatMember.isKickedOrRestricted: Boolean get() = this is BannedChatMember