-
Notifications
You must be signed in to change notification settings - Fork 3
/
passport.clj
27 lines (22 loc) · 971 Bytes
/
passport.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
(ns telegrambot-lib.api.passport
"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"
{:changed "0.2.0"}
([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))))