tgbotapi/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/GetUpdates.kt

27 lines
762 B
Kotlin
Raw Normal View History

package dev.inmo.tgbotapi.extensions.api
2020-02-15 09:33:04 +00:00
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.GetUpdates
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.update.abstracts.Update
2020-02-15 09:33:04 +00:00
suspend fun TelegramBot.getUpdates(
2020-02-15 09:33:04 +00:00
offset: UpdateIdentifier? = null,
2020-03-31 05:28:48 +00:00
limit: Int = getUpdatesLimit.last,
2020-03-17 14:24:31 +00:00
timeout: Seconds? = null,
2020-02-15 09:33:04 +00:00
allowed_updates: List<String>? = ALL_UPDATES_LIST
) = execute(
GetUpdates(
offset, limit, timeout, allowed_updates
)
)
suspend fun TelegramBot.getUpdates(
2020-02-15 09:33:04 +00:00
lastUpdate: Update,
2020-03-31 05:28:48 +00:00
limit: Int = getUpdatesLimit.last,
2020-03-17 14:24:31 +00:00
timeout: Seconds? = null,
2020-02-15 09:33:04 +00:00
allowed_updates: List<String>? = ALL_UPDATES_LIST
) = getUpdates(
lastUpdate.updateId + 1, limit, timeout, allowed_updates
)