1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-22 16:47:13 +00:00

fixes of build

This commit is contained in:
InsanusMokrassar 2024-01-04 17:31:47 +06:00
parent 52fd55eea5
commit d9c39d7a26
4 changed files with 8 additions and 10 deletions

View File

@ -55,7 +55,7 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQue
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
) = onCallbackQuery (
initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
initialFilter * !SimpleFilter<InlineMessageIdDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
subcontextUpdatesFilter,
markerFactory,
scenarioReceiver

View File

@ -20,7 +20,7 @@ sealed interface GiveawayPublicResults: GiveawayInfo, GiveawayResults, WithPrevi
val publicWinners: Boolean
val refunded: Boolean
@Serializable(GiveawayPublicResults.Companion::class)
@Serializable
data class Refunded(
@SerialName(chatsField)
override val chat: PreviewChat,
@ -50,7 +50,7 @@ sealed interface GiveawayPublicResults: GiveawayInfo, GiveawayResults, WithPrevi
override val premiumMonths: Int? = null
}
@Serializable(GiveawayPublicResults.Companion::class)
@Serializable
data class Winners (
@SerialName(chatsField)
override val chat: PreviewChat,
@ -157,6 +157,5 @@ sealed interface GiveawayPublicResults: GiveawayInfo, GiveawayResults, WithPrevi
Surrogate.serializer().serialize(encoder, surrogate)
}
}
}

View File

@ -48,6 +48,7 @@ internal data class RawUpdate constructor(
private val chat_boost: ChatBoostUpdated? = null,
private val removed_chat_boost: ChatBoostRemoved? = null
) {
@Transient
private var initedUpdate: Update? = null
/**
* @return One of children of [Update] interface or null in case of unknown type of update

View File

@ -1,9 +1,7 @@
package dev.inmo.tgbotapi.types.message.ChatEvents
import dev.inmo.tgbotapi.TestsJsonFormat
import dev.inmo.tgbotapi.extensions.utils.asMessageUpdate
import dev.inmo.tgbotapi.extensions.utils.asMigratedToSupergroup
import dev.inmo.tgbotapi.extensions.utils.asSupergroupEventMessage
import dev.inmo.tgbotapi.extensions.utils.*
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.update.abstracts.UpdateDeserializationStrategy
import kotlin.test.Test
@ -41,9 +39,9 @@ class MigratedToSupergroupTest {
}
""".trimIndent()
val update = TestsJsonFormat.decodeFromString(UpdateDeserializationStrategy, payload)
val message = update.asMessageUpdate() ?: fail("update should be of MessageUpdate subtype")
val data = message.data.asSupergroupEventMessage() ?: fail("message should be of SupergroupEventMessage subtype")
val event = data.chatEvent.asMigratedToSupergroup() ?: fail("event should be of SupergroupChatCreated subtype")
val message = update.messageUpdateOrThrow()
val data = message.data.supergroupEventMessageOrThrow()
val event = data.chatEvent.migratedToSupergroupOrThrow()
assertEquals(IdChatIdentifier(57005), event.migratedFrom)
}