-
Notifications
You must be signed in to change notification settings - Fork 3
/
core.clj
59 lines (51 loc) · 2.26 KB
/
core.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(ns telegrambot-lib.edit.core
"Telegram Bot API Updating/Modifying Messages - function implementations.
* https://core.telegram.org/bots/api#updating-messages"
(:gen-class)
(:require [telegrambot-lib.http :as http]))
(defn edit-message-text
"Use this method to edit text and game messages.
On success, if edited message is sent by the bot, the edited Message is
returned, otherwise True is returned."
[this content]
(http/request this "editMessageText" content))
(defn edit-message-caption
"Use this method to edit captions of messages.
On success, if edited message is sent by the bot, the edited Message is
returned, otherwise True is returned."
[this content]
(http/request this "editMessageCaption" content))
(defn edit-message-media
"Use this method to edit animation, audio, document, photo, or video messages.
If a message is a part of a message album, then it can be edited only to a
photo or a video. Otherwise, message type can be changed arbitrarily.
When inline message is edited, new file can't be uploaded.
Use previously uploaded file via its file_id or specify a URL.
On success, if the edited message was sent by the bot, the edited Message
is returned, otherwise True is returned."
[this content]
(http/request this "editMessageMedia" content))
(defn edit-message-reply-markup
"Use this method to edit only the reply markup of messages.
On success, if edited message is sent by the bot, the edited Message is
returned, otherwise True is returned."
[this content]
(http/request this "editMessageReplyMarkup" content))
(defn stop-poll
"Use this method to stop a poll which was sent by the bot.
On success, the stopped Poll with the final results is returned."
[this content]
(http/request this "stopPoll" content))
(defn delete-message
"Use this method to delete a message, including service messages.
Returns True on success."
[this content]
(http/request this "deleteMessage" content))
(def behavior
"Map for extending the core TBot record with functions."
{:edit-message-text edit-message-text
:edit-message-caption edit-message-caption
:edit-message-media edit-message-media
:edit-message-reply-markup edit-message-reply-markup
:stop-poll stop-poll
:delete-message delete-message})