mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-29 04:47:48 +00:00
25 lines
837 B
Kotlin
25 lines
837 B
Kotlin
|
package com.github.insanusmokrassar.TelegramBotAPI.requests.stickers
|
||
|
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||
|
import kotlinx.serialization.*
|
||
|
import kotlinx.serialization.internal.BooleanSerializer
|
||
|
|
||
|
@Serializable
|
||
|
data class SetStickerPositionInSet(
|
||
|
@SerialName(stickerField)
|
||
|
val sticker: FileId,
|
||
|
@SerialName(positionField)
|
||
|
val position: Int
|
||
|
) : SimpleRequest<Boolean> {
|
||
|
init {
|
||
|
if (position < 0) {
|
||
|
throw IllegalArgumentException("Position must be positive or 0")
|
||
|
}
|
||
|
}
|
||
|
|
||
|
override fun method(): String = "setStickerPositionInSet"
|
||
|
override fun resultSerializer(): KSerializer<Boolean> = BooleanSerializer
|
||
|
}
|