2020-02-15 09:33:04 +00:00
|
|
|
package com.github.insanusmokrassar.TelegramBotAPI.extensions.api
|
|
|
|
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.GetUpdates
|
2020-03-17 14:24:31 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
2020-02-15 09:33:04 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
|
|
|
|
|
|
|
suspend fun RequestsExecutor.getUpdates(
|
|
|
|
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 RequestsExecutor.getUpdates(
|
|
|
|
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
|
|
|
|
)
|