Skip to content

Commit b83d76a

Browse files
authored
Merge pull request #426 from mircoianese/api_9.1_9.2
API v9.1 + v9.2
2 parents 249c6f4 + 8eb50e4 commit b83d76a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+643
-31
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![codecov](https://codecov.io/gh/pengrad/java-telegram-bot-api/branch/master/graph/badge.svg)](https://codecov.io/gh/pengrad/java-telegram-bot-api)
55

66
Java library for interacting with [Telegram Bot API](https://core.telegram.org/bots/api)
7-
- Full support of all Bot API 9.0 methods
7+
- Full support of all Bot API 9.2 methods
88
- Telegram [Passport](https://core.telegram.org/passport) and Decryption API
99
- Bot [Payments](https://core.telegram.org/bots/payments)
1010
- [Gaming Platform](https://telegram.org/blog/games)
@@ -13,14 +13,14 @@ Java library for interacting with [Telegram Bot API](https://core.telegram.org/b
1313

1414
Gradle:
1515
```groovy
16-
implementation 'com.github.pengrad:java-telegram-bot-api:9.0.0'
16+
implementation 'com.github.pengrad:java-telegram-bot-api:9.2.0'
1717
```
1818
Maven:
1919
```xml
2020
<dependency>
2121
<groupId>com.github.pengrad</groupId>
2222
<artifactId>java-telegram-bot-api</artifactId>
23-
<version>9.0.0</version>
23+
<version>9.2.0</version>
2424
</dependency>
2525
```
2626
[JAR with all dependencies on release page](https://github.com/pengrad/java-telegram-bot-api/releases)

README_RU.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![codecov](https://codecov.io/gh/pengrad/java-telegram-bot-api/branch/master/graph/badge.svg)](https://codecov.io/gh/pengrad/java-telegram-bot-api)
55

66
Java библиотека, созданная для работы с [Telegram Bot API](https://core.telegram.org/bots/api)
7-
- Полная поддержка всех методов BOT API 9.0
7+
- Полная поддержка всех методов BOT API 9.2
88
- Поддержка Telegram [паспорта](https://core.telegram.org/passport) и дешифровки (Decryption API);
99
- Поддержка [платежей](https://core.telegram.org/bots/payments);
1010
- [Игровая платформа](https://telegram.org/blog/games).
@@ -13,14 +13,14 @@ Java библиотека, созданная для работы с [Telegram B
1313

1414
Gradle:
1515
```groovy
16-
implementation 'com.github.pengrad:java-telegram-bot-api:9.0.0'
16+
implementation 'com.github.pengrad:java-telegram-bot-api:9.2.0'
1717
```
1818
Maven:
1919
```xml
2020
<dependency>
2121
<groupId>com.github.pengrad</groupId>
2222
<artifactId>java-telegram-bot-api</artifactId>
23-
<version>9.0.0</version>
23+
<version>9.2.0</version>
2424
</dependency>
2525
```
2626
Также JAR со всеми зависимостями можно найти [в релизах](https://github.com/pengrad/java-telegram-bot-api/releases).

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=com.github.pengrad
2-
VERSION_NAME=9.0.0
2+
VERSION_NAME=9.2.0
33

44
POM_DESCRIPTION=Java API for Telegram Bot API
55
POM_URL=https://github.com/pengrad/java-telegram-bot-api/

library/src/main/java/com/pengrad/telegrambot/model/Chat.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public enum Type {
3131

3232
private Boolean is_forum;
3333

34+
private Boolean is_direct_messages;
35+
3436
public Long id() {
3537
return id;
3638
}
@@ -55,6 +57,10 @@ public Boolean isForum() {
5557
return is_forum != null && is_forum;
5658
}
5759

60+
public Boolean isDirectMessages() {
61+
return is_direct_messages != null && is_direct_messages;
62+
}
63+
5864
public String title() {
5965
return title;
6066
}
@@ -69,6 +75,7 @@ public boolean equals(Object o) {
6975
Objects.equals(first_name, chat.first_name) &&
7076
Objects.equals(last_name, chat.last_name) &&
7177
Objects.equals(is_forum, chat.is_forum) &&
78+
Objects.equals(is_direct_messages, chat.is_direct_messages) &&
7279
Objects.equals(username, chat.username) &&
7380
Objects.equals(title, chat.title);
7481
}
@@ -86,6 +93,7 @@ public String toString() {
8693
", first_name='" + first_name + '\'' +
8794
", last_name='" + last_name + '\'' +
8895
", is_forum=" + is_forum +
96+
", is_direct_messages=" + is_direct_messages +
8997
", username='" + username + '\'' +
9098
", title='" + title + '\'' +
9199
'}';

library/src/main/java/com/pengrad/telegrambot/model/ChatAdministratorRights.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class ChatAdministratorRights implements Serializable {
2626
private Boolean can_edit_stories;
2727
private Boolean can_delete_stories;
2828
private Boolean can_manage_topics;
29+
private Boolean can_manage_direct_messages;
2930

3031
public Boolean isAnonymous() {
3132
return is_anonymous != null && is_anonymous;
@@ -87,6 +88,10 @@ public Boolean canManageTopics() {
8788
return can_manage_topics != null && can_manage_topics;
8889
}
8990

91+
public Boolean canManageDirectMessages() {
92+
return can_manage_direct_messages != null && can_manage_direct_messages;
93+
}
94+
9095
public ChatAdministratorRights canManageChat(boolean canManageChat) {
9196
this.can_manage_chat = canManageChat;
9297
return this;
@@ -157,6 +162,11 @@ public ChatAdministratorRights canManageTopics(boolean canManageTopics) {
157162
return this;
158163
}
159164

165+
public ChatAdministratorRights canManageDirectMessages(boolean can_manage_direct_messages) {
166+
this.can_manage_direct_messages = can_manage_direct_messages;
167+
return this;
168+
}
169+
160170
@Override
161171
public boolean equals(Object o) {
162172
if (this == o) return true;
@@ -177,7 +187,8 @@ public boolean equals(Object o) {
177187
Objects.equals(can_post_stories, that.can_post_stories) &&
178188
Objects.equals(can_edit_stories, that.can_edit_stories) &&
179189
Objects.equals(can_delete_stories, that.can_delete_stories) &&
180-
Objects.equals(can_manage_topics, that.can_manage_topics);
190+
Objects.equals(can_manage_topics, that.can_manage_topics) &&
191+
Objects.equals(can_manage_direct_messages, that.can_manage_direct_messages);
181192
}
182193

183194
@Override
@@ -196,7 +207,8 @@ public int hashCode() {
196207
can_post_stories,
197208
can_edit_stories,
198209
can_delete_stories,
199-
can_manage_topics);
210+
can_manage_topics,
211+
can_manage_direct_messages);
200212
}
201213

202214
@Override
@@ -217,6 +229,7 @@ public String toString() {
217229
", can_edit_stories=" + can_edit_stories +
218230
", can_delete_stories=" + can_delete_stories +
219231
", can_manage_topics=" + can_manage_topics +
232+
", can_manage_direct_messages=" + can_manage_direct_messages +
220233
'}';
221234
}
222235

library/src/main/java/com/pengrad/telegrambot/model/ChatFullInfo.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ public enum Type {
3434
private String last_name;
3535

3636
private Boolean is_forum;
37+
private Boolean is_direct_messages;
3738
private ChatPhoto photo;
3839
private String[] active_usernames;
3940
private Birthdate birthdate;
4041
private BusinessIntro business_intro;
4142
private BusinessLocation business_location;
4243
private BusinessOpeningHours business_opening_hours;
4344
private Chat personal_chat;
45+
private Chat parent_chat;
4446
private ReactionType[] available_reactions;
4547
private Integer accent_color_id;
4648
private Integer max_reaction_count;
@@ -98,6 +100,10 @@ public Boolean isForum() {
98100
return is_forum != null && is_forum;
99101
}
100102

103+
public Boolean isDirectMessages() {
104+
return is_direct_messages != null && is_direct_messages;
105+
}
106+
101107
public String title() {
102108
return title;
103109
}
@@ -130,6 +136,10 @@ public Chat personalChat() {
130136
return personal_chat;
131137
}
132138

139+
public Chat parentChat() {
140+
return parent_chat;
141+
}
142+
133143
public ReactionType[] availableReactions() {
134144
return available_reactions;
135145
}
@@ -272,6 +282,7 @@ public boolean equals(Object o) {
272282
Objects.equals(first_name, chat.first_name) &&
273283
Objects.equals(last_name, chat.last_name) &&
274284
Objects.equals(is_forum, chat.is_forum) &&
285+
Objects.equals(is_direct_messages, chat.is_direct_messages) &&
275286
Objects.equals(username, chat.username) &&
276287
Objects.equals(title, chat.title) &&
277288
Objects.equals(photo, chat.photo) &&
@@ -281,6 +292,7 @@ public boolean equals(Object o) {
281292
Objects.equals(business_location, chat.business_location) &&
282293
Objects.equals(business_opening_hours, chat.business_opening_hours) &&
283294
Objects.equals(personal_chat, chat.personal_chat) &&
295+
Objects.equals(parent_chat, chat.parent_chat) &&
284296
Arrays.equals(available_reactions, chat.available_reactions) &&
285297
Objects.equals(accent_color_id, chat.accent_color_id) &&
286298
Objects.equals(max_reaction_count, chat.max_reaction_count) &&
@@ -327,6 +339,7 @@ public String toString() {
327339
", first_name='" + first_name + '\'' +
328340
", last_name='" + last_name + '\'' +
329341
", is_forum=" + is_forum +
342+
", is_direct_messages=" + is_direct_messages +
330343
", username='" + username + '\'' +
331344
", title='" + title + '\'' +
332345
", photo=" + photo +
@@ -336,6 +349,7 @@ public String toString() {
336349
", business_location=" + business_location +
337350
", business_opening_hours=" + business_opening_hours +
338351
", personal_chat=" + personal_chat +
352+
", parent_chat=" + parent_chat +
339353
", available_reactions=" + Arrays.toString(available_reactions) +
340354
", accent_color_id=" + accent_color_id +
341355
", max_reaction_count=" + max_reaction_count +

library/src/main/java/com/pengrad/telegrambot/model/ChatMember.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public enum Status {
3535
private Boolean can_edit_stories;
3636
private Boolean can_delete_stories;
3737
private Boolean can_manage_topics;
38+
private Boolean can_manage_direct_messages;
3839
private Boolean is_member;
3940
private Boolean can_send_messages;
4041

@@ -129,6 +130,10 @@ public Boolean canManageTopics() {
129130
return can_manage_topics != null && can_manage_topics;
130131
}
131132

133+
public Boolean canManageDirectMessages() {
134+
return can_manage_direct_messages != null && can_manage_direct_messages;
135+
}
136+
132137
public Boolean isMember() {
133138
return is_member != null && is_member;
134139
}
@@ -198,6 +203,7 @@ public boolean equals(Object o) {
198203
Objects.equals(can_edit_stories, that.can_edit_stories) &&
199204
Objects.equals(can_delete_stories, that.can_delete_stories) &&
200205
Objects.equals(can_manage_topics, that.can_manage_topics) &&
206+
Objects.equals(can_manage_direct_messages, that.can_manage_direct_messages) &&
201207
Objects.equals(is_member, that.is_member) &&
202208
Objects.equals(can_send_messages, that.can_send_messages) &&
203209
Objects.equals(can_send_audios, that.can_send_audios) &&
@@ -233,6 +239,7 @@ public int hashCode() {
233239
can_edit_stories,
234240
can_delete_stories,
235241
can_manage_topics,
242+
can_manage_direct_messages,
236243
is_member,
237244
can_send_messages,
238245
can_send_audios,
@@ -269,6 +276,7 @@ public String toString() {
269276
", can_edit_stories=" + can_edit_stories +
270277
", can_delete_stories=" + can_delete_stories +
271278
", can_manage_topics=" + can_manage_topics +
279+
", can_manage_direct_messages=" + can_manage_direct_messages +
272280
", is_member=" + is_member +
273281
", can_send_messages=" + can_send_messages +
274282
", can_send_audios=" + can_send_audios +
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.pengrad.telegrambot.model
2+
3+
@Suppress("unused")
4+
data class DirectMessagesTopic (
5+
@get:JvmName("topicId") val topicId: Int,
6+
@get:JvmName("user") val user: User?
7+
) {
8+
}

library/src/main/java/com/pengrad/telegrambot/model/ExternalReplyInfo.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.pengrad.telegrambot.model;
22

3+
import com.pengrad.telegrambot.model.checklist.Checklist;
34
import com.pengrad.telegrambot.model.giveaway.Giveaway;
45
import com.pengrad.telegrambot.model.giveaway.GiveawayWinners;
56
import com.pengrad.telegrambot.model.message.origin.MessageOrigin;
@@ -28,6 +29,7 @@ public class ExternalReplyInfo implements Serializable {
2829
private VideoNote video_note;
2930
private Voice voice;
3031
private Boolean has_media_spoiler;
32+
private Checklist checklist;
3133
private Contact contact;
3234
private Dice dice;
3335
private Game game;
@@ -97,6 +99,10 @@ public Boolean hasMediaSpoiler() {
9799
return has_media_spoiler;
98100
}
99101

102+
public Checklist checklist() {
103+
return checklist;
104+
}
105+
100106
public Contact contact() {
101107
return contact;
102108
}
@@ -138,12 +144,12 @@ public boolean equals(Object o) {
138144
if (this == o) return true;
139145
if (o == null || getClass() != o.getClass()) return false;
140146
ExternalReplyInfo that = (ExternalReplyInfo) o;
141-
return Objects.equals(origin, that.origin) && Objects.equals(chat, that.chat) && Objects.equals(message_id, that.message_id) && Objects.equals(link_preview_options, that.link_preview_options) && Objects.equals(animation, that.animation) && Objects.equals(audio, that.audio) && Objects.equals(paid_media, that.paid_media) && Objects.equals(document, that.document) && Arrays.equals(photo, that.photo) && Objects.equals(sticker, that.sticker) && Objects.equals(story, that.story) && Objects.equals(video, that.video) && Objects.equals(video_note, that.video_note) && Objects.equals(voice, that.voice) && Objects.equals(has_media_spoiler, that.has_media_spoiler) && Objects.equals(contact, that.contact) && Objects.equals(dice, that.dice) && Objects.equals(game, that.game) && Objects.equals(giveaway, that.giveaway) && Objects.equals(giveaway_winners, that.giveaway_winners) && Objects.equals(invoice, that.invoice) && Objects.equals(location, that.location) && Objects.equals(poll, that.poll) && Objects.equals(venue, that.venue);
147+
return Objects.equals(origin, that.origin) && Objects.equals(chat, that.chat) && Objects.equals(message_id, that.message_id) && Objects.equals(link_preview_options, that.link_preview_options) && Objects.equals(animation, that.animation) && Objects.equals(audio, that.audio) && Objects.equals(paid_media, that.paid_media) && Objects.equals(document, that.document) && Arrays.equals(photo, that.photo) && Objects.equals(sticker, that.sticker) && Objects.equals(story, that.story) && Objects.equals(video, that.video) && Objects.equals(video_note, that.video_note) && Objects.equals(voice, that.voice) && Objects.equals(has_media_spoiler, that.has_media_spoiler) && Objects.equals(checklist, that.checklist) && Objects.equals(contact, that.contact) && Objects.equals(dice, that.dice) && Objects.equals(game, that.game) && Objects.equals(giveaway, that.giveaway) && Objects.equals(giveaway_winners, that.giveaway_winners) && Objects.equals(invoice, that.invoice) && Objects.equals(location, that.location) && Objects.equals(poll, that.poll) && Objects.equals(venue, that.venue);
142148
}
143149

144150
@Override
145151
public int hashCode() {
146-
int result = Objects.hash(origin, chat, message_id, link_preview_options, animation, audio, paid_media, document, sticker, story, video, video_note, voice, has_media_spoiler, contact, dice, game, giveaway, giveaway_winners, invoice, location, poll, venue);
152+
int result = Objects.hash(origin, chat, message_id, link_preview_options, animation, audio, paid_media, document, sticker, story, video, video_note, voice, has_media_spoiler, checklist, contact, dice, game, giveaway, giveaway_winners, invoice, location, poll, venue);
147153
result = 31 * result + Arrays.hashCode(photo);
148154
return result;
149155
}
@@ -166,6 +172,7 @@ public String toString() {
166172
", video_note=" + video_note +
167173
", voice=" + voice +
168174
", has_media_spoiler=" + has_media_spoiler +
175+
", checklist=" + checklist +
169176
", contact=" + contact +
170177
", dice=" + dice +
171178
", game=" + game +

0 commit comments

Comments
 (0)