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

Commit 6e78632

Browse files
authored
issue-145: Review/Implement Bot API 7.0 Changes (#146)
* issue-145: Review/Implement Bot API 7.0 Changes - Added new functions: delete-messages, forward-messages, copy-messages, set-message-reaction, get-user-chat-boosts. - Optional parameter replacements. (reply_to_message_id and allow_sending_without_reply with the field reply_parameters) - Optional parameter replacements. (disable_web_page_preview with link_preview_options) - Readme updates to include github pages and update License years. - Project and dependency version bumps. - Generated pom.
1 parent ac2a8a9 commit 6e78632

File tree

9 files changed

+200
-68
lines changed

9 files changed

+200
-68
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ Each API call is a Clojure function, with docstrings outlining required and opti
1515
1616
## Usage
1717

18-
See the [Wiki for documentation](https://github.com/wdhowe/telegrambot-lib/wiki).
18+
Documentation is available on the project wiki and is also published to github pages.
19+
20+
- [Wiki](https://github.com/wdhowe/telegrambot-lib/wiki)
21+
- [Github pages](https://wdhowe.github.io/telegrambot-lib/)
1922

2023
## License
2124

22-
Copyright © 2020-2023 Bill Howe and contributors
25+
Copyright © 2020-2024 Bill Howe and contributors
2326

2427
This program and the accompanying materials are made available under the
2528
terms of the Eclipse Public License 2.0 which is available at

pom.xml

Lines changed: 3 additions & 3 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.11.0</version>
7+
<version>2.12.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>b73beb09dbdb0be3341b5e7b6c650c304054933f</tag>
21+
<tag>fba36072cbeac666cdefdf4d0726cfc4218864a2</tag>
2222
</scm>
2323
<build>
2424
<sourceDirectory>src</sourceDirectory>
@@ -94,7 +94,7 @@
9494
<dependency>
9595
<groupId>potemkin</groupId>
9696
<artifactId>potemkin</artifactId>
97-
<version>0.4.6</version>
97+
<version>0.4.7</version>
9898
</dependency>
9999
<dependency>
100100
<groupId>cheshire</groupId>

project.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject telegrambot-lib "2.11.0"
1+
(defproject telegrambot-lib "2.12.0"
22

33
;;; Project Metadata
44
:description "A library for interacting with the Telegram Bot API."
@@ -12,7 +12,7 @@
1212
[org.clojure/clojure "1.11.1"]
1313
[org.clojure/core.async "1.6.681"]
1414
[org.clojure/tools.logging "1.2.4"]
15-
[potemkin "0.4.6"]]
15+
[potemkin "0.4.7"]]
1616

1717
;;; Profiles
1818
;; logback-classic must be 1.3.x due to jdk8 support.
@@ -37,7 +37,7 @@
3737

3838
:jsonista {:dependencies [[metosin/jsonista "0.3.8"]]}
3939

40-
:data.json {:dependencies [[org.clojure/data.json "2.4.0"]]}}
40+
:data.json {:dependencies [[org.clojure/data.json "2.5.0"]]}}
4141

4242
;;; Testing
4343
:test-selectors {:default (complement :json)

src/telegrambot_lib/api/edit.clj

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
Optional
2424
- parse_mode ; entity parsing in message
2525
- entities ; list of MessageEntity - can use instead of parse_mode
26-
- disable_web_page_preview ; disable link previews
26+
- link_preview_options ; link preview generation options.
2727
- reply_markup ; inline keyboard markup"
28-
{:changed "0.2.0"}
28+
{:changed "2.12.0"}
2929

3030
([this content]
3131
(http/request this "editMessageText" content))
@@ -55,9 +55,9 @@
5555
5656
Optional
5757
- parse_mode ; entity parsing in message
58-
- disable_web_page_preview ; disable link previews
58+
- link_preview_options ; link preview generation options.
5959
- reply_markup ; inline keyboard markup"
60-
{:added "0.2.0"}
60+
{:changed "2.12.0"}
6161

6262
([this content]
6363
(http/request this "editMessageText" content))
@@ -286,3 +286,22 @@
286286
(let [content {:chat_id chat_id
287287
:message_id message_id}]
288288
(delete-message this content))))
289+
290+
(defn delete-messages
291+
"Use this method to delete multiple messages simultaneously.
292+
If some of the specified messages can't be found, they are skipped.
293+
Returns True on success.
294+
295+
Required
296+
- this ; a bot instance
297+
- chat_id ; target chat or username (@user)
298+
- message_ids ; List of IDs, 1-100 messages to delete."
299+
{:added "2.12.0"}
300+
301+
([this content]
302+
(http/request this "deleteMessages" content))
303+
304+
([this chat_id message_ids]
305+
(let [content {:chat_id chat_id
306+
:message_ids message_ids}]
307+
(delete-messages this content))))

src/telegrambot_lib/api/games.clj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
- message_thread_id ; id of the target thread of the forum.
2323
- disable_notification ; send message silently
2424
- protect_content ; protect content from forwarding/saving
25-
- reply_to_message_id ; id of original message
26-
- allow_sending_without_reply ; true to send message even if replied-to message is not found
25+
- reply_parameters ; Description of the message to reply to
2726
- reply_markup ; inline keyboard markup"
28-
{:changed "0.2.0"}
27+
{:changed "2.12.0"}
2928

3029
([this content]
3130
(http/request this "sendGame" content))

0 commit comments

Comments
 (0)