From 6394e1a52b5513534a24d658b3b59e48bbb1d4be Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 15 May 2020 22:02:53 +0600 Subject: [PATCH] setWebhookInfo --- CHANGELOG.md | 1 + .../extensions/api/webhook/SetWebhookInfo.kt | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10c5550390..898141fe75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ * `TelegramBotAPI-extensions-api`: * Long Polling extensions now are deprecated in this project. It was replaced into `TelegramBotAPI-extensions-utils` * Several `telegramBot` functions was renamed into `telegramBotWithCustomClientConfig` + * Add one more `setWebhookInfo` realisation * `TelegramBotAPI-extensions-utils`: * Extension `toTelegramUpdate` was added * Long Polling extensions were added diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhookInfo.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhookInfo.kt index 73fb7c418e..9e4a80a11b 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhookInfo.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/webhook/SetWebhookInfo.kt @@ -5,6 +5,19 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.SetWebhook +/** + * Use this method to send information about webhook (like [url] and [certificate]) + */ +suspend fun RequestsExecutor.setWebhookInfo( + url: String, + maxAllowedConnections: Int? = null, + allowedUpdates: List? = null +) = execute( + SetWebhook( + url, maxAllowedConnections, allowedUpdates + ) +) + /** * Use this method to send information about webhook (like [url] and [certificate]) */