mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
replace UnknownUpdate
This commit is contained in:
parent
961fa65415
commit
a8ca45a4bd
@ -9,6 +9,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Telegr
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.PreCheckoutQuery
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.ShippingQuery
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.Poll
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.UnknownUpdate
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.updateIdField
|
||||
import kotlinx.serialization.SerialName
|
||||
@ -50,7 +51,10 @@ internal data class RawUpdate constructor(
|
||||
shipping_query != null -> ShippingQueryUpdate(updateId, shipping_query)
|
||||
pre_checkout_query != null -> PreCheckoutQueryUpdate(updateId, pre_checkout_query)
|
||||
poll != null -> PollUpdate(updateId, poll)
|
||||
else -> UnknownUpdate(updateId, raw)
|
||||
else -> UnknownUpdate(
|
||||
updateId,
|
||||
raw
|
||||
)
|
||||
}.also {
|
||||
initedUpdate = it
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.update
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||
|
||||
data class UnknownUpdate(
|
||||
override val updateId: UpdateIdentifier,
|
||||
override val data: String
|
||||
) : Update
|
@ -12,6 +12,11 @@ interface Update {
|
||||
val data: Any
|
||||
}
|
||||
|
||||
data class UnknownUpdate(
|
||||
override val updateId: UpdateIdentifier,
|
||||
override val data: String
|
||||
) : Update
|
||||
|
||||
internal object UpdateSerializerWithoutDeserialization : KSerializer<Update> {
|
||||
override val descriptor: SerialDescriptor = StringDescriptor.withName("UpdateSerializerWithoutDeserialization")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user