Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.

Commit e84b590

Browse files
committed
issue-157: Review/Implement Bot API 7.4 Changes
- Updated fns for the telegram bot api 7.4 release. - Bumped project version. - Generated pom.
1 parent aaf0518 commit e84b590

File tree

8 files changed

+71
-34
lines changed

8 files changed

+71
-34
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>telegrambot-lib</groupId>
55
<artifactId>telegrambot-lib</artifactId>
66
<packaging>jar</packaging>
7-
<version>2.14.0</version>
7+
<version>2.15.0</version>
88
<name>telegrambot-lib</name>
99
<description>A library for interacting with the Telegram Bot API.</description>
1010
<url>https://github.com/wdhowe/telegrambot-lib</url>
@@ -18,7 +18,7 @@
1818
<url>https://github.com/wdhowe/telegrambot-lib</url>
1919
<connection>scm:git:git://github.com/wdhowe/telegrambot-lib.git</connection>
2020
<developerConnection>scm:git:ssh://git@github.com/wdhowe/telegrambot-lib.git</developerConnection>
21-
<tag>e47f5e254d0449d65863bb3e21ad00d80728674a</tag>
21+
<tag>aaf0518d942f99c768b94bf6e582506b7c3dd6da</tag>
2222
</scm>
2323
<build>
2424
<sourceDirectory>src</sourceDirectory>

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject telegrambot-lib "2.14.0"
1+
(defproject telegrambot-lib "2.15.0"
22

33
;;; Project Metadata
44
:description "A library for interacting with the Telegram Bot API."

src/telegrambot_lib/api/edit.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@
8787
Optional
8888
- parse_mode ; entity parsing in message
8989
- caption_entities ; list of MessageEntity - can use instead of parse_mode
90+
- show_caption_above_media ; True, to show caption above the message media.
9091
- reply_markup ; inline keyboard markup"
91-
{:changed "0.2.0"}
92+
{:changed "2.15.0"}
9293

9394
([this content]
9495
(http/request this "editMessageCaption" content))

src/telegrambot_lib/api/games.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
- message_thread_id ; id of the target thread of the forum.
2424
- disable_notification ; send message silently
2525
- protect_content ; protect content from forwarding/saving
26+
- message_effect_id ; ID of the message effect to be added to the message.
2627
- reply_parameters ; Description of the message to reply to
2728
- reply_markup ; inline keyboard markup"
28-
{:changed "2.13.0"}
29+
{:changed "2.15.0"}
2930

3031
([this content]
3132
(http/request this "sendGame" content))

src/telegrambot_lib/api/methods.clj

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@
8181
- link_preview_options ; link preview generation options.
8282
- disable_notification ; send silently
8383
- protect_content ; protect content from forwarding/saving
84+
- message_effect_id ; ID of the message effect to be added to the message.
8485
- reply_parameters ; Description of the message to reply to
8586
- reply_markup ; additional interface options"
86-
{:changed "2.13.0"}
87+
{:changed "2.15.0"}
8788

8889
([this content]
8990
(http/request this "sendMessage" content))
@@ -183,11 +184,12 @@
183184
- caption ; new caption for media
184185
- parse_mode ; entity parsing
185186
- caption_entities ; list of MessageEntity - can use instead of parse_mode
187+
- show_caption_above_media ; True, to show caption above the message media.
186188
- disable_notification ; send silently
187189
- protect_content ; protect content from forwarding/saving
188190
- reply_parameters ; Description of the message to reply to
189191
- reply_markup ; additional interface options"
190-
{:changed "2.12.0"}
192+
{:changed "2.15.0"}
191193

192194
([this content]
193195
(http/request this "copyMessage" content))
@@ -258,12 +260,14 @@
258260
- caption ; photo caption
259261
- parse_mode ; entity parsing in photo caption
260262
- caption_entities ; list of MessageEntity - can use instead of parse_mode
263+
- show_caption_above_media ; True, to show caption above the message media.
261264
- has_spoiler ; true if photo needs to be covered with spoiler animation.
262265
- disable_notification ; send silently
263266
- protect_content ; protect content from forwarding/saving
267+
- message_effect_id ; ID of the message effect to be added to the message.
264268
- reply_parameters ; Description of the message to reply to
265269
- reply_markup ; additional interface options"
266-
{:changed "2.13.0"}
270+
{:changed "2.15.0"}
267271

268272
([this content]
269273
(http/request this "sendPhoto" content))
@@ -302,9 +306,10 @@
302306
- thumbnail ; thumbnail of the file sent
303307
- disable_notification ; send silently
304308
- protect_content ; protect content from forwarding/saving
309+
- message_effect_id ; ID of the message effect to be added to the message.
305310
- reply_parameters ; Description of the message to reply to
306311
- reply_markup ; additional interface options"
307-
{:changed "2.13.0"}
312+
{:changed "2.15.0"}
308313

309314
([this content]
310315
(http/request this "sendAudio" content))
@@ -339,9 +344,10 @@
339344
- disable_content_type_detection ; disable auto content type detection for files uploaded
340345
- disable_notification ; send silently
341346
- protect_content ; protect content from forwarding/saving
347+
- message_effect_id ; ID of the message effect to be added to the message.
342348
- reply_parameters ; Description of the message to reply to
343349
- reply_markup ; additional interface options"
344-
{:changed "2.13.0"}
350+
{:changed "2.15.0"}
345351

346352
([this content]
347353
(http/request this "sendDocument" content))
@@ -376,14 +382,16 @@
376382
- caption ; video caption
377383
- parse_mode ; entity parsing in video caption
378384
- caption_entities ; list of MessageEntity - can use instead of parse_mode
385+
- show_caption_above_media ; True, to show caption above the message media.
379386
- has_spoiler ; true if video needs to be covered with spoiler animation.
380387
- thumbnail ; thumbnail of file sent
381388
- supports_streaming ; true if uploaded video is ok for streaming
382389
- disable_notification ; send silently
383390
- protect_content ; protect content from forwarding/saving
391+
- message_effect_id ; ID of the message effect to be added to the message.
384392
- reply_parameters ; Description of the message to reply to
385393
- reply_markup ; additional interface options"
386-
{:changed "2.13.0"}
394+
{:changed "2.15.0"}
387395

388396
([this content]
389397
(http/request this "sendVideo" content))
@@ -418,13 +426,15 @@
418426
- caption ; animation caption
419427
- parse_mode ; entity parsing in animation caption
420428
- caption_entities ; list of MessageEntity - can use instead of parse_mode
429+
- show_caption_above_media ; True, to show caption above the message media.
421430
- has_spoiler ; true if animation needs to be covered with spoiler animation.
422431
- thumbnail ; thumbnail of file sent
423432
- disable_notification ; send silently
424433
- protect_content ; protect content from forwarding/saving
434+
- message_effect_id ; ID of the message effect to be added to the message.
425435
- reply_parameters ; Description of the message to reply to
426436
- reply_markup ; additional interface options"
427-
{:changed "2.13.0"}
437+
{:changed "2.15.0"}
428438

429439
([this content]
430440
(http/request this "sendAnimation" content))
@@ -461,9 +471,10 @@
461471
- caption_entities ; list of MessageEntity - can use instead of parse_mode
462472
- disable_notification ; send silently
463473
- protect_content ; protect content from forwarding/saving
474+
- message_effect_id ; ID of the message effect to be added to the message.
464475
- reply_parameters ; Description of the message to reply to
465476
- reply_markup ; additional interface options"
466-
{:changed "2.13.0"}
477+
{:changed "2.15.0"}
467478

468479
([this content]
469480
(http/request this "sendVoice" content))
@@ -496,9 +507,10 @@
496507
- thumbnail ; thumbnail of the file sent
497508
- disable_notification ; send silently
498509
- protect_content ; protect content from forwarding/saving
510+
- message_effect_id ; ID of the message effect to be added to the message.
499511
- reply_parameters ; Description of the message to reply to
500512
- reply_markup ; additional interface options"
501-
{:changed "2.13.0"}
513+
{:changed "2.15.0"}
502514

503515
([this content]
504516
(http/request this "sendVideoNote" content))
@@ -528,8 +540,9 @@
528540
- message_thread_id ; id of the target thread of the forum.
529541
- disable_notification ; send silently
530542
- protect_content ; protect content from forwarding/saving
543+
- message_effect_id ; ID of the message effect to be added to the message.
531544
- reply_parameters ; Description of the message to reply to"
532-
{:changed "2.13.0"}
545+
{:changed "2.15.0"}
533546

534547
([this content]
535548
(http/request this "sendMediaGroup" content))
@@ -564,9 +577,10 @@
564577
- proximity_alert_radius ; 1-100000 meters max distance for proximity alerts
565578
- disable_notification ; send silently
566579
- protect_content ; protect content from forwarding/saving
580+
- message_effect_id ; ID of the message effect to be added to the message.
567581
- reply_parameters ; Description of the message to reply to
568582
- reply_markup ; additional interface options"
569-
{:changed "2.13.0"}
583+
{:changed "2.15.0"}
570584

571585
([this content]
572586
(http/request this "sendLocation" content))
@@ -736,9 +750,10 @@
736750
- google_place_type ; Google Places type of venue
737751
- disable_notification ; send silently
738752
- protect_content ; protect content from forwarding/saving
753+
- message_effect_id ; ID of the message effect to be added to the message.
739754
- reply_parameters ; Description of the message to reply to
740755
- reply_markup ; additional interface options"
741-
{:changed "2.13.0"}
756+
{:changed "2.15.0"}
742757

743758
([this content]
744759
(http/request this "sendVenue" content))
@@ -777,9 +792,10 @@
777792
- vcard ; 'vCard' formatted additional data
778793
- disable_notification ; send silently
779794
- protect_content ; protect content from forwarding/saving
795+
- message_effect_id ; ID of the message effect to be added to the message.
780796
- reply_parameters ; Description of the message to reply to
781797
- reply_markup ; additional interface options"
782-
{:changed "2.13.0"}
798+
{:changed "2.15.0"}
783799

784800
([this content]
785801
(http/request this "sendContact" content))
@@ -832,9 +848,10 @@
832848
- is_closed ; true if poll needs to be immediately closed
833849
- disable_notification ; send silently
834850
- protect_content ; protect content from forwarding/saving
851+
- message_effect_id ; ID of the message effect to be added to the message.
835852
- reply_parameters ; Description of the message to reply to
836853
- reply_markup ; additional interface options"
837-
{:changed "2.14.0"}
854+
{:changed "2.15.0"}
838855

839856
([this content]
840857
(http/request this "sendPoll" content))
@@ -866,9 +883,10 @@
866883
- emoji ; image for dice animation (default: dice)
867884
- disable_notification ; send silently
868885
- protect_content ; protect content from forwarding/saving
886+
- message_effect_id ; ID of the message effect to be added to the message.
869887
- reply_parameters ; Description of the message to reply to
870888
- reply_markup ; additional interface options"
871-
{:changed "2.13.0"}
889+
{:changed "2.15.0"}
872890
content-map?)
873891

874892
(defmethod send-dice true

src/telegrambot_lib/api/payments.clj

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
- title ; product name
2121
- description ; product description
2222
- payload ; internal bot defined invoice payload
23-
- provider_token ; payments provider token
2423
- currency ; three letter ISO 4217 currency code
2524
- prices ; 'LabeledPrice' array breakdown (price, tax, discount, delivery, etc)
2625
2726
Optional
27+
- provider_token ; payments provider token, omit for Telegram Stars payments.
2828
- message_thread_id ; id of the target thread of the forum.
2929
- max_tip_amount ; integer of max tip accepted. US $1.45 = 145.
3030
- suggested_tip_amounts ; json serialized array of integer tip amounts, 4 max suggested tips,
@@ -44,32 +44,31 @@
4444
- is_flexible ; true if final price depends on shipping method
4545
- disable_notification ; send message silently
4646
- protect_content ; protect content from forwarding/saving
47+
- message_effect_id ; ID of the message effect to be added to the message.
4748
- reply_parameters ; Description of the message to reply to
4849
- reply_markup ; inline keyboard markup"
49-
{:changed "2.12.0"}
50+
{:changed "2.15.0"}
5051

5152
([this content]
5253
(http/request this "sendInvoice" content))
5354

54-
([this chat_id title description payload provider_token
55+
([this chat_id title description payload
5556
currency prices]
5657
(let [content {:chat_id chat_id
5758
:title title
5859
:description description
5960
:payload payload
60-
:provider_token provider_token
6161
:currency currency
6262
:prices prices}]
6363
(send-invoice this content)))
6464

65-
([this chat_id title description payload provider_token
65+
([this chat_id title description payload
6666
currency prices & optional]
6767
(let [content (merge (first optional)
6868
{:chat_id chat_id
6969
:title title
7070
:description description
7171
:payload payload
72-
:provider_token provider_token
7372
:currency currency
7473
:prices prices})]
7574
(send-invoice this content))))
@@ -82,11 +81,11 @@
8281
- title ; product name
8382
- description ; product description
8483
- payload ; internal bot defined invoice payload
85-
- provider_token ; payments provider token
8684
- currency ; three letter ISO 4217 currency code
8785
- prices ; 'LabeledPrice' array breakdown (price, tax, discount, delivery, etc)
8886
8987
Optional
88+
- provider_token ; payments provider token, omit for Telegram Stars payments.
9089
- max_tip_amount ; integer of max tip accepted. US $1.45 = 145.
9190
- suggested_tip_amounts ; json serialized array of integer tip amounts, 4 max suggested tips,
9291
positive numbers, increasing order, and must not exceed max_tip_amount.
@@ -102,26 +101,24 @@
102101
- send_phone_number_to_provider ; true to send phone number to provider
103102
- send_email_to_provider ; true to send email to provider
104103
- is_flexible ; true if final price depends on shipping method"
105-
{:added "2.1.0"}
104+
{:changed "2.15.0"}
106105

107106
([this content]
108107
(http/request this "createInvoiceLink" content))
109108

110-
([this title description payload provider_token currency prices]
109+
([this title description payload currency prices]
111110
(let [content {:title title
112111
:description description
113112
:payload payload
114-
:provider_token provider_token
115113
:currency currency
116114
:prices prices}]
117115
(create-invoice-link this content)))
118116

119-
([this title description payload provider_token currency prices & optional]
117+
([this title description payload currency prices & optional]
120118
(let [content (merge (first optional)
121119
{:title title
122120
:description description
123121
:payload payload
124-
:provider_token provider_token
125122
:currency currency
126123
:prices prices})]
127124
(create-invoice-link this content))))
@@ -224,3 +221,21 @@
224221
:ok false
225222
:error_message error_message}]
226223
(answer-precheckout-query-error this content))))
224+
225+
(defn refund-star-payment
226+
"Refunds a successful payment in Telegram Stars.
227+
Returns True on success.
228+
229+
Required
230+
- this ; a bot instance
231+
- user_id ; ID of the user whose payment will be refunded.
232+
- telegram_payment_charge_id ; Telegram payment identifier."
233+
{:added "2.15.0"}
234+
235+
([this content]
236+
(http/request this "refundStarPayment" content))
237+
238+
([this user_id telegram_payment_charge_id]
239+
(let [content {:user_id user_id
240+
:telegram_payment_charge_id telegram_payment_charge_id}]
241+
(refund-star-payment this content))))

src/telegrambot_lib/api/stickers.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
- emoji ; Emoji associated with the recently uploaded sticker.
2626
- disable_notification ; true to send message silently
2727
- protect_content ; protect content from forwarding/saving
28+
- message_effect_id ; ID of the message effect to be added to the message.
2829
- reply_parameters ; Description of the message to reply to
2930
- reply_markup ; additional interface options"
30-
{:changed "2.13.0"}
31+
{:changed "2.15.0"}
3132

3233
([this content]
3334
(http/request this "sendSticker" content))

src/telegrambot_lib/core.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@
165165
answer-shipping-query-ok
166166
answer-shipping-query-error
167167
answer-precheckout-query-ok
168-
answer-precheckout-query-error]
168+
answer-precheckout-query-error
169+
refund-star-payment]
169170
[stickers
170171
send-sticker
171172
get-sticker-set

0 commit comments

Comments
 (0)