Skip to content

Commit 970df19

Browse files
committed
Add Bot API 10.1 support: Join Request Queries, Poll link, InputMediaLink, and rich message fields
- User: add supports_join_request_queries field - Chat: add guard_bot field - ChatJoinRequest: add query_id field - AnswerChatJoinRequestQuery: new method for processing join request queries - PollMedia: add link field (Link type) - InputMediaLink: new class for HTTP links in poll options - InputPollOptionMedia: allow InputMediaLink as valid type - Message: add rich_message field - InputMessageContentDeserializer: support InputRichMessageContent deserialization - Tests: update TestUser, TestPollMedia, TestInputRichMessageContent
1 parent 96abf03 commit 970df19

25 files changed

Lines changed: 143 additions & 20 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
99
<packaging>pom</packaging>
10-
<version>10.0.0</version>
10+
<version>10.1.0</version>
1111

1212
<modules>
1313
<module>telegrambots-meta</module>

telegrambots-abilities/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>10.0.0</version>
10+
<version>10.1.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-abilities</artifactId>
@@ -93,12 +93,12 @@
9393
<dependency>
9494
<groupId>org.telegram</groupId>
9595
<artifactId>telegrambots-webhook</artifactId>
96-
<version>10.0.0</version>
96+
<version>10.1.0</version>
9797
</dependency>
9898
<dependency>
9999
<groupId>org.telegram</groupId>
100100
<artifactId>telegrambots-longpolling</artifactId>
101-
<version>10.0.0</version>
101+
<version>10.1.0</version>
102102
</dependency>
103103

104104
<dependency>

telegrambots-abilities/src/test/java/org/telegram/telegrambots/abilitybots/api/db/TestMapDBContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ void testToString() throws Exception {
153153
var.set(TestUtils.USER);
154154
db.commit();
155155
Var<User> changedVar = db.getVar(varName);
156-
assertEquals("MapDBVar{var=User(id=1, firstName=first, isBot=false, lastName=last, userName=username, languageCode=null, canJoinGroups=false, canReadAllGroupMessages=false, supportInlineQueries=false, isPremium=false, addedToAttachmentMenu=false, canConnectToBusiness=false, hasMainWebApp=false, hasTopicsEnabled=false, allowsUsersToCreateTopics=null, canManageBots=null, supportsGuestQueries=null)}", ((MapDBVar) (changedVar)).toString());
156+
assertEquals("MapDBVar{var=User(id=1, firstName=first, isBot=false, lastName=last, userName=username, languageCode=null, canJoinGroups=false, canReadAllGroupMessages=false, supportInlineQueries=false, isPremium=false, addedToAttachmentMenu=false, canConnectToBusiness=false, hasMainWebApp=false, hasTopicsEnabled=false, allowsUsersToCreateTopics=null, canManageBots=null, supportsGuestQueries=null, supportsJoinRequestQueries=null)}", ((MapDBVar) (changedVar)).toString());
157157
}
158158
}

telegrambots-client-jetty-adapter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>10.0.0</version>
10+
<version>10.1.0</version>
1111
</parent>
1212

1313
<name>Telegram Bots Client Jetty HttpClient adapter</name>

telegrambots-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>10.0.0</version>
10+
<version>10.1.0</version>
1111
</parent>
1212

1313
<name>Telegram Bots Client</name>

telegrambots-extensions/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Just import add the library to your project with one of these options:
1616
<dependency>
1717
<groupId>org.telegram</groupId>
1818
<artifactId>telegrambots-extensions</artifactId>
19-
<version>10.0.0</version>
19+
<version>10.1.0</version>
2020
</dependency>
2121
```
2222

2323
2. Using Gradle:
2424

2525
```gradle
26-
implementation 'org.telegram:telegrambots-extensions:10.0.0'
26+
implementation 'org.telegram:telegrambots-extensions:10.1.0'
2727
```

telegrambots-extensions/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>10.0.0</version>
10+
<version>10.1.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-extensions</artifactId>
@@ -78,12 +78,12 @@
7878
<dependency>
7979
<groupId>org.telegram</groupId>
8080
<artifactId>telegrambots-webhook</artifactId>
81-
<version>10.0.0</version>
81+
<version>10.1.0</version>
8282
</dependency>
8383
<dependency>
8484
<groupId>org.telegram</groupId>
8585
<artifactId>telegrambots-longpolling</artifactId>
86-
<version>10.0.0</version>
86+
<version>10.1.0</version>
8787
</dependency>
8888

8989
<dependency>

telegrambots-longpolling/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.telegram</groupId>
88
<artifactId>Bots</artifactId>
9-
<version>10.0.0</version>
9+
<version>10.1.0</version>
1010
</parent>
1111

1212
<artifactId>telegrambots-longpolling</artifactId>

telegrambots-meta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.telegram</groupId>
99
<artifactId>Bots</artifactId>
10-
<version>10.0.0</version>
10+
<version>10.1.0</version>
1111
</parent>
1212

1313
<artifactId>telegrambots-meta</artifactId>

telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/AnswerChatJoinRequestQuery.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,8 @@ public void validate() throws TelegramApiValidationException {
6262
if (result == null || result.isEmpty()) {
6363
throw new TelegramApiValidationException("Result parameter can't be empty", this);
6464
}
65+
if (!result.equals("approve") && !result.equals("decline") && !result.equals("queue")) {
66+
throw new TelegramApiValidationException("Result parameter must be one of: approve, decline, queue", this);
67+
}
6568
}
6669
}

0 commit comments

Comments
 (0)