mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-03 07:09:23 +00:00
fixes in startGettingUpdates
This commit is contained in:
@@ -14,7 +14,7 @@ private val updatesListSerializer = ListSerializer(
|
||||
@Serializable
|
||||
data class GetUpdates(
|
||||
val offset: UpdateIdentifier? = null,// set `last update id + 1` to receive next part of updates
|
||||
val limit: Int? = null,
|
||||
val limit: Int = getUpdatesLimit.last,
|
||||
val timeout: Seconds? = null,
|
||||
val allowed_updates: List<String>? = ALL_UPDATES_LIST
|
||||
): SimpleRequest<List<Update>> {
|
||||
@@ -25,4 +25,10 @@ data class GetUpdates(
|
||||
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
|
||||
init {
|
||||
if (limit !in getUpdatesLimit) {
|
||||
error("GetUpdates request can be called only with limit in range $getUpdatesLimit (actual value is $limit)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@ typealias DiceResult = Int
|
||||
|
||||
typealias Seconds = Int
|
||||
|
||||
val getUpdatesLimit = 1 .. 100
|
||||
val callbackQueryAnswerLength = 0 until 200
|
||||
val captionLength = 0 until 1024
|
||||
val textLength = 0 until 4096
|
||||
|
Reference in New Issue
Block a user