-
Notifications
You must be signed in to change notification settings - Fork 3
/
protocol.clj
32 lines (26 loc) · 1.15 KB
/
protocol.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(ns telegrambot-lib.updates.protocol
"Getting updates - protocol definitions.
* https://core.telegram.org/bots/api#getupdates")
(defprotocol Updates
"Getting bot message updates."
(get-updates [this] [this content]
"Use this method to receive incoming updates using long polling.
An Array of Update objects is returned.")
(set-webhook [this content]
"Use this method to specify a url and receive incoming updates via
an outgoing webhook. Whenever there is an update for the bot, we
will send an HTTPS POST request to the specified url, containing
a JSON-serialized Update. In case of an unsuccessful request, we
will give up after a reasonable amount of attempts.
Returns True on success.")
(delete-webhook [this]
"Use this method to remove webhook integration if you decide to
switch back to getUpdates.
Returns True on success.
Requires no parameters.")
(get-webhook [this]
"Use this method to get current webhook status.
Requires no parameters.
On success, returns a WebhookInfo object.
If the bot is using getUpdates, will return an object with the
url field empty."))