diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatIdentifier.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatIdentifier.kt index 36c74899cd..176f3292d3 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatIdentifier.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/ChatIdentifier.kt @@ -29,9 +29,10 @@ data class Username( } override fun equals(other: Any?): Boolean { - return super.equals(other) || other ?.let { - super.equals("@$it") - } ?: false + return super.equals(other) || when (other) { + is String -> super.equals("@$other") + else -> false + } } }