From 5064aed99fdbdd020c3133cda07c702ca67376f3 Mon Sep 17 00:00:00 2001 From: Netkas Date: Tue, 14 Feb 2023 21:04:16 -0500 Subject: [PATCH] Added \TgBotLib > Bot > deleteWebhook() --- src/TgBotLib/Bot.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/TgBotLib/Bot.php b/src/TgBotLib/Bot.php index d9eb610..6dabf6c 100644 --- a/src/TgBotLib/Bot.php +++ b/src/TgBotLib/Bot.php @@ -184,4 +184,21 @@ ])); return true; } + + /** + * Use this method to remove webhook integration if you decide to switch back to getUpdates. + * Returns True on success. + * + * @param bool $drop_pending_updates + * @return bool + * @throws TelegramException + */ + public function deleteWebhook(bool $drop_pending_updates=false): bool + { + $this->sendRequest('deleteWebhook', [ + 'drop_pending_updates' => $drop_pending_updates + ]); + + return true; + } } \ No newline at end of file