From 826f5f8c92bf8ae1c27733c6fa2d90fdf24728fa Mon Sep 17 00:00:00 2001 From: neiro Date: Sat, 26 Oct 2019 21:09:06 +0300 Subject: [PATCH] Allow to delete webhook Sometimes it might be useful to change the webhook. Unfortunately, there's no other way to change it once it has been configured so we need to delete the webhook and set it again. This commit will add the missing functionality. --- src/morse/api.clj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/morse/api.clj b/src/morse/api.clj index e50ce05..24f1d73 100644 --- a/src/morse/api.clj +++ b/src/morse/api.clj @@ -40,6 +40,11 @@ query {:url webhook-url}] (http/get url {:as :json :query-params query}))) +(defn delete-webhook + "Removes WebHook to stop receiving updates from chats" + [token] + (let [url (str base-url token "/deleteWebhook")] + (http/get url {:as :json}))) (defn get-file "Gets url of the file"