-
Notifications
You must be signed in to change notification settings - Fork 3
/
core.clj
148 lines (146 loc) · 3.54 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
(ns telegrambot-lib.core
"A Clojure library for interacting with the Telegram Bot API.
- [Getting started](https://github.com/wdhowe/telegrambot-lib#usage)"
(:gen-class)
(:require [telegrambot-lib.config :as conf]
[telegrambot-lib.api.edit :as edit]
[telegrambot-lib.api.games :as games]
[telegrambot-lib.api.inline :as inline]
[telegrambot-lib.api.methods :as methods]
[telegrambot-lib.api.passport :as passport]
[telegrambot-lib.api.payments :as payments]
[telegrambot-lib.api.stickers :as stickers]
[telegrambot-lib.api.updates :as updates]
[potemkin :refer [import-vars]]))
(defn create
"Create a new Telegram Bot API instance.
- No argument attempts to load the `bot-token` from the environment.
- 1 argument will use the passed in `bot-token`."
([]
(create (conf/get-token)))
([bot-token]
{:bot-token bot-token}))
;; Make all Telegram functions available directly in this namespace.
(import-vars
[edit
edit-message-text
edit-message-text-inline
edit-message-caption
edit-message-caption-inline
edit-message-media
edit-message-media-inline
edit-message-reply-markup
edit-message-reply-markup-inline
stop-poll
delete-message]
[games
send-game
set-game-score
set-game-score-inline
get-game-high-scores
get-game-high-scores-inline]
[inline
answer-inline-query
answer-web-app-query]
[methods
call
get-me
log-out
close
send-message
forward-message
copy-message
send-photo
send-audio
send-document
send-video
send-animation
send-voice
send-video-note
send-media-group
send-location
edit-message-live-location
edit-message-live-location-inline
stop-message-live-location
stop-message-live-location-inline
send-venue
send-contact
send-poll
send-dice
send-chat-action
get-user-profile-photos
get-file
kick-chat-member
ban-chat-member
unban-chat-member
restrict-chat-member
promote-chat-member
set-chat-administrator-custom-title
ban-chat-sender-chat
unban-chat-sender-chat
set-chat-permissions
export-chat-invite-link
create-chat-invite-link
edit-chat-invite-link
revoke-chat-invite-link
approve-chat-join-request
decline-chat-join-request
set-chat-photo
delete-chat-photo
set-chat-title
set-chat-description
pin-chat-message
unpin-chat-message
unpin-all-chat-messages
leave-chat
get-chat
get-chat-administrators
get-chat-members-count
get-chat-member-count
get-chat-member
set-chat-sticker-set
delete-chat-sticker-set
get-forum-topic-icon-stickers
create-forum-topic
edit-forum-topic
close-forum-topic
reopen-forum-topic
delete-forum-topic
unpin-all-forum-topic-messages
edit-general-forum-topic
close-general-forum-topic
reopen-general-forum-topic
hide-general-forum-topic
unhide-general-forum-topic
answer-callback-query
set-my-commands
delete-my-commands
get-my-commands
set-chat-menu-button
get-chat-menu-button
set-my-default-administrator-rights
get-my-default-administrator-rights]
[passport
set-passport-data-errors]
[payments
send-invoice
create-invoice-link
answer-shipping-query-ok
answer-shipping-query-error
answer-precheckout-query-ok
answer-precheckout-query-error]
[stickers
send-sticker
get-sticker-set
get-custom-emoji-stickers
upload-sticker-file
create-new-sticker-set
add-sticker-to-set
set-sticker-position-in-set
delete-sticker-from-set
set-sticker-set-thumb]
[updates
get-updates
set-webhook
delete-webhook
get-webhook-info])