From 3932dc622bfbb61b50e4476cd5c4c0b1104213ba Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 16 Apr 2021 21:57:17 +0600 Subject: [PATCH] update for FromUserMessage : Message --- tgbotapi.core/build.gradle | 6 +++--- .../types/MessageEntity/textsources/TextSourceSerializer.kt | 1 - tgbotapi.core/src/jvmTest/kotlin/Temporal.kt | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tgbotapi.core/build.gradle b/tgbotapi.core/build.gradle index cbfc29632b..be6596e3be 100644 --- a/tgbotapi.core/build.gradle +++ b/tgbotapi.core/build.gradle @@ -109,11 +109,11 @@ kapt { arguments { arg( "com.github.matfax.klassindex.IndexSubclasses", - "dev.inmo.tgbotapi.types.update.abstracts.Update", - "dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChatEvent", +// "dev.inmo.tgbotapi.types.update.abstracts.Update", +// "dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChatEvent", // "dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValue", // "dev.inmo.tgbotapi.types.message.content.abstracts.ResendableContent", -// "dev.inmo.tgbotapi.types.message.abstracts.Message", + "dev.inmo.tgbotapi.types.message.abstracts.Message", // "dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.EncryptedPassportElement", // "dev.inmo.tgbotapi.types.passport.PassportElementError", // "dev.inmo.tgbotapi.types.CallbackQuery.CallbackQuery", diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextSourceSerializer.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextSourceSerializer.kt index f3474b1363..a9f76a93ad 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextSourceSerializer.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextSourceSerializer.kt @@ -30,7 +30,6 @@ private val baseSerializers: Map> = mapOf( "cashtag" to CashTagTextSource.serializer(), ) -@Serializer(TextSource::class) object TextSourceSerializer : TypedSerializer(TextSource::class, baseSerializers) { override fun include(type: String, serializer: KSerializer) { require(type !in baseSerializers.keys) diff --git a/tgbotapi.core/src/jvmTest/kotlin/Temporal.kt b/tgbotapi.core/src/jvmTest/kotlin/Temporal.kt index bdd90212f7..031dd4456d 100644 --- a/tgbotapi.core/src/jvmTest/kotlin/Temporal.kt +++ b/tgbotapi.core/src/jvmTest/kotlin/Temporal.kt @@ -42,8 +42,7 @@ val result = mutableMapOf, Set>>() fun main() { - result[Update::class] = KlassIndex.getSubclasses(Update::class).toSet() - result[ChatEvent::class] = KlassIndex.getSubclasses(ChatEvent::class).toSet() + result[Message::class] = KlassIndex.getSubclasses(Message::class).toSet() println("import dev.inmo.tgbotapi.utils.PreviewFeature") val importsToFuns = result.keys.flatMap { println("import ${it.qualifiedName}")