-
Notifications
You must be signed in to change notification settings - Fork 3
/
core.clj
29 lines (24 loc) · 1.05 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
(ns telegrambot-lib.passport.core
"Telegram Passport - function implementations.
- <https://core.telegram.org/bots/api#telegram-passport>
Most functions are multi-arity with the following options:
- Send all parameters in a 'content' map.
- Send only the required parameters as simple values.
- Send the required paraemters as simple values and then 'optional' parameters in a map."
(:gen-class)
(:require [telegrambot-lib.http :as http]))
(defn set-passport-data-errors
"Informs a user that some of the Telegram Passport elements they provided contains errors.
Required
- this ; a bot instance
- user_id ; user identifier
- errors ; json array of 'PassportElementError' describing the errors"
([this content]
(http/request this "setPassportDataErrors" content))
([this user_id errors]
(let [content {:user_id user_id
:errors errors}]
(set-passport-data-errors this content))))
(def behavior
"Map for extending the core TBot record with functions."
{:set-passport-data-errors set-passport-data-errors})