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

add support of paid emoji

This commit is contained in:
InsanusMokrassar 2024-08-14 22:37:19 +06:00
parent e9a172565e
commit 76eae0a54f

View File

@ -43,6 +43,15 @@ sealed interface Reaction {
}
}
@Serializable(Reaction.Companion::class)
class Paid : Reaction {
override val type: String
get() = Companion.type
companion object {
const val type: String = "paid"
}
}
@Serializable(Reaction.Companion::class)
data class Unknown(
override val type: String,
@ -73,6 +82,7 @@ sealed interface Reaction {
return when {
surrogate.emoji != null -> Emoji(surrogate.emoji)
surrogate.customEmojiId != null -> CustomEmoji(surrogate.customEmojiId)
surrogate.type == Paid.type -> Paid()
else -> Unknown(surrogate.type, json)
}
}