mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
fixes of build
This commit is contained in:
parent
52fd55eea5
commit
d9c39d7a26
@ -55,7 +55,7 @@ suspend fun <BC : BehaviourContext> BC.onUnhandledInlineMessageIdDataCallbackQue
|
|||||||
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
|
||||||
) = onCallbackQuery (
|
) = onCallbackQuery (
|
||||||
initialFilter * !SimpleFilter<MessageDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
initialFilter * !SimpleFilter<InlineMessageIdDataCallbackQuery> { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) },
|
||||||
subcontextUpdatesFilter,
|
subcontextUpdatesFilter,
|
||||||
markerFactory,
|
markerFactory,
|
||||||
scenarioReceiver
|
scenarioReceiver
|
||||||
|
@ -20,7 +20,7 @@ sealed interface GiveawayPublicResults: GiveawayInfo, GiveawayResults, WithPrevi
|
|||||||
val publicWinners: Boolean
|
val publicWinners: Boolean
|
||||||
val refunded: Boolean
|
val refunded: Boolean
|
||||||
|
|
||||||
@Serializable(GiveawayPublicResults.Companion::class)
|
@Serializable
|
||||||
data class Refunded(
|
data class Refunded(
|
||||||
@SerialName(chatsField)
|
@SerialName(chatsField)
|
||||||
override val chat: PreviewChat,
|
override val chat: PreviewChat,
|
||||||
@ -50,7 +50,7 @@ sealed interface GiveawayPublicResults: GiveawayInfo, GiveawayResults, WithPrevi
|
|||||||
override val premiumMonths: Int? = null
|
override val premiumMonths: Int? = null
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable(GiveawayPublicResults.Companion::class)
|
@Serializable
|
||||||
data class Winners (
|
data class Winners (
|
||||||
@SerialName(chatsField)
|
@SerialName(chatsField)
|
||||||
override val chat: PreviewChat,
|
override val chat: PreviewChat,
|
||||||
@ -157,6 +157,5 @@ sealed interface GiveawayPublicResults: GiveawayInfo, GiveawayResults, WithPrevi
|
|||||||
|
|
||||||
Surrogate.serializer().serialize(encoder, surrogate)
|
Surrogate.serializer().serialize(encoder, surrogate)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -48,6 +48,7 @@ internal data class RawUpdate constructor(
|
|||||||
private val chat_boost: ChatBoostUpdated? = null,
|
private val chat_boost: ChatBoostUpdated? = null,
|
||||||
private val removed_chat_boost: ChatBoostRemoved? = null
|
private val removed_chat_boost: ChatBoostRemoved? = null
|
||||||
) {
|
) {
|
||||||
|
@Transient
|
||||||
private var initedUpdate: Update? = null
|
private var initedUpdate: Update? = null
|
||||||
/**
|
/**
|
||||||
* @return One of children of [Update] interface or null in case of unknown type of update
|
* @return One of children of [Update] interface or null in case of unknown type of update
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.types.message.ChatEvents
|
package dev.inmo.tgbotapi.types.message.ChatEvents
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.TestsJsonFormat
|
import dev.inmo.tgbotapi.TestsJsonFormat
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asMessageUpdate
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asMigratedToSupergroup
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.asSupergroupEventMessage
|
|
||||||
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
import dev.inmo.tgbotapi.types.IdChatIdentifier
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.UpdateDeserializationStrategy
|
import dev.inmo.tgbotapi.types.update.abstracts.UpdateDeserializationStrategy
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
@ -41,9 +39,9 @@ class MigratedToSupergroupTest {
|
|||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
val update = TestsJsonFormat.decodeFromString(UpdateDeserializationStrategy, payload)
|
val update = TestsJsonFormat.decodeFromString(UpdateDeserializationStrategy, payload)
|
||||||
val message = update.asMessageUpdate() ?: fail("update should be of MessageUpdate subtype")
|
val message = update.messageUpdateOrThrow()
|
||||||
val data = message.data.asSupergroupEventMessage() ?: fail("message should be of SupergroupEventMessage subtype")
|
val data = message.data.supergroupEventMessageOrThrow()
|
||||||
val event = data.chatEvent.asMigratedToSupergroup() ?: fail("event should be of SupergroupChatCreated subtype")
|
val event = data.chatEvent.migratedToSupergroupOrThrow()
|
||||||
|
|
||||||
assertEquals(IdChatIdentifier(57005), event.migratedFrom)
|
assertEquals(IdChatIdentifier(57005), event.migratedFrom)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user