Skip to content

Commit 8f742c8

Browse files
authored
Merge pull request #430 from mircoianese/api_9.3
BOT API v9.3
2 parents 6c9ce4b + fd8259b commit 8f742c8

43 files changed

Lines changed: 392 additions & 57 deletions

Some content is hidden

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

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.2 methods
7+
- Full support of all Bot API 9.3 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.2.1'
16+
implementation 'com.github.pengrad:java-telegram-bot-api:9.3.0'
1717
```
1818
Maven:
1919
```xml
2020
<dependency>
2121
<groupId>com.github.pengrad</groupId>
2222
<artifactId>java-telegram-bot-api</artifactId>
23-
<version>9.2.1</version>
23+
<version>9.3.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.2
7+
- Полная поддержка всех методов BOT API 9.3
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.2.1'
16+
implementation 'com.github.pengrad:java-telegram-bot-api:9.3.0'
1717
```
1818
Maven:
1919
```xml
2020
<dependency>
2121
<groupId>com.github.pengrad</groupId>
2222
<artifactId>java-telegram-bot-api</artifactId>
23-
<version>9.2.1</version>
23+
<version>9.3.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.2.1
2+
VERSION_NAME=9.3.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/ChatFullInfo.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.pengrad.telegrambot.model.business.BusinessLocation;
66
import com.pengrad.telegrambot.model.business.BusinessOpeningHours;
77
import com.pengrad.telegrambot.model.gift.AcceptedGiftTypes;
8+
import com.pengrad.telegrambot.model.gift.unique.UniqueGiftColors;
89
import com.pengrad.telegrambot.model.reaction.ReactionType;
910

1011

@@ -75,6 +76,9 @@ public enum Type {
7576
private ChatLocation location;
7677
private Boolean can_send_gift;
7778
private AcceptedGiftTypes accepted_gift_types;
79+
private UserRating rating;
80+
private Integer paid_message_star_count;
81+
private UniqueGiftColors unique_gift_colors;
7882

7983
public Long id() {
8084
return id;
@@ -272,6 +276,18 @@ public AcceptedGiftTypes acceptedGiftTypes() {
272276
return accepted_gift_types;
273277
}
274278

279+
public UserRating rating() {
280+
return rating;
281+
}
282+
283+
public Integer paidMessageStarCount() {
284+
return paid_message_star_count;
285+
}
286+
287+
public UniqueGiftColors uniqueGiftColors() {
288+
return unique_gift_colors;
289+
}
290+
275291
@Override
276292
public boolean equals(Object o) {
277293
if (this == o) return true;
@@ -323,7 +339,10 @@ public boolean equals(Object o) {
323339
Objects.equals(custom_emoji_sticker_set_name, chat.custom_emoji_sticker_set_name) &&
324340
Objects.equals(linked_chat_id, chat.linked_chat_id) &&
325341
Objects.equals(location, chat.location) &&
326-
Objects.equals(accepted_gift_types, chat.accepted_gift_types);
342+
Objects.equals(accepted_gift_types, chat.accepted_gift_types) &&
343+
Objects.equals(rating, chat.rating) &&
344+
Objects.equals(paid_message_star_count, chat.paid_message_star_count) &&
345+
Objects.equals(unique_gift_colors, chat.unique_gift_colors);
327346
}
328347

329348
@Override
@@ -381,6 +400,9 @@ public String toString() {
381400
", linked_chat_id=" + linked_chat_id +
382401
", location=" + location +
383402
", accepted_gift_types=" + accepted_gift_types +
403+
", rating=" + rating +
404+
", paid_message_star_count=" + paid_message_star_count +
405+
", unique_gift_colors=" + unique_gift_colors +
384406
'}';
385407
}
386408
}

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
public class ForumTopic implements Serializable {
77
private final static long serialVersionUID = 0L;
88

9-
private Integer message_thread_id;
9+
private Long message_thread_id;
1010
private String name;
1111
private Integer icon_color;
1212
private String icon_custom_emoji_id;
13+
private Boolean is_name_implicit;
1314

14-
public Integer messageThreadId() {
15+
public Long messageThreadId() {
1516
return message_thread_id;
1617
}
1718

@@ -27,6 +28,10 @@ public String iconCustomEmojiId() {
2728
return icon_custom_emoji_id;
2829
}
2930

31+
public Boolean isNameImplicit() {
32+
return is_name_implicit;
33+
}
34+
3035
@Override
3136
public boolean equals(Object o) {
3237
if (this == o) return true;
@@ -37,15 +42,17 @@ public boolean equals(Object o) {
3742
return Objects.equals(message_thread_id, that.message_thread_id) &&
3843
Objects.equals(name, that.name) &&
3944
Objects.equals(icon_color, that.icon_color) &&
40-
Objects.equals(icon_custom_emoji_id, that.icon_custom_emoji_id);
45+
Objects.equals(icon_custom_emoji_id, that.icon_custom_emoji_id) &&
46+
Objects.equals(is_name_implicit, that.is_name_implicit);
4147
}
4248

4349
@Override
4450
public int hashCode() {
4551
return Objects.hash(message_thread_id,
4652
name,
4753
icon_color,
48-
icon_custom_emoji_id);
54+
icon_custom_emoji_id,
55+
is_name_implicit);
4956
}
5057

5158
@Override
@@ -55,6 +62,7 @@ public String toString() {
5562
", name='" + name + '\'' +
5663
", icon_color=" + icon_color +
5764
", icon_custom_emoji_id='" + icon_custom_emoji_id + '\'' +
65+
", is_name_implicit=" + is_name_implicit +
5866
'}';
5967
}
6068
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class ForumTopicCreated implements Serializable {
99
private String name;
1010
private Integer icon_color;
1111
private String icon_custom_emoji_id;
12+
private Boolean is_name_implicit;
1213

1314
public String name() {
1415
return name;
@@ -22,6 +23,10 @@ public String iconCustomEmojiId() {
2223
return icon_custom_emoji_id;
2324
}
2425

26+
public Boolean isNameImplicit() {
27+
return is_name_implicit;
28+
}
29+
2530
@Override
2631
public boolean equals(Object o) {
2732
if (this == o) return true;
@@ -31,14 +36,16 @@ public boolean equals(Object o) {
3136

3237
return Objects.equals(name, that.name) &&
3338
Objects.equals(icon_color, that.icon_color) &&
34-
Objects.equals(icon_custom_emoji_id, that.icon_custom_emoji_id);
39+
Objects.equals(icon_custom_emoji_id, that.icon_custom_emoji_id) &&
40+
Objects.equals(is_name_implicit, that.is_name_implicit);
3541
}
3642

3743
@Override
3844
public int hashCode() {
3945
return Objects.hash(name,
4046
icon_color,
41-
icon_custom_emoji_id);
47+
icon_custom_emoji_id,
48+
is_name_implicit);
4249
}
4350

4451
@Override
@@ -47,6 +54,7 @@ public String toString() {
4754
"name='" + name + '\'' +
4855
", icon_color=" + icon_color +
4956
", icon_custom_emoji_id='" + icon_custom_emoji_id + '\'' +
57+
", is_name_implicit=" + is_name_implicit +
5058
'}';
5159
}
5260
}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class Message extends MaybeInaccessibleMessage implements Serializable {
3232
private final static long serialVersionUID = 0L;
3333

34-
private Integer message_thread_id;
34+
private Long message_thread_id;
3535
private DirectMessagesTopic direct_messages_topic;
3636
private User from;
3737
private Chat sender_chat;
@@ -122,6 +122,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
122122
private WebAppData web_app_data;
123123
private GiftInfo gift;
124124
private UniqueGiftInfo unique_gift;
125+
private GiftInfo gift_upgrade_sent;
125126
private PaidMessagePriceChanged paid_message_price_changed;
126127
private SuggestedPostApproved suggested_post_approved;
127128
private SuggestedPostApprovalFailed suggested_post_approval_failed;
@@ -131,7 +132,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
131132
private DirectMessagePriceChanged direct_message_price_changed;
132133
private Integer paid_star_count;
133134

134-
public Integer messageThreadId() {
135+
public Long messageThreadId() {
135136
return message_thread_id;
136137
}
137138

@@ -496,6 +497,10 @@ public UniqueGiftInfo uniqueGift() {
496497
return unique_gift;
497498
}
498499

500+
public GiftInfo giftUpgradeSent() {
501+
return gift_upgrade_sent;
502+
}
503+
499504
public PaidMessagePriceChanged paidMessagePriceChanged() {
500505
return paid_message_price_changed;
501506
}
@@ -648,6 +653,7 @@ public boolean equals(Object o) {
648653
Objects.equals(web_app_data, message.web_app_data) &&
649654
Objects.equals(gift, message.gift) &&
650655
Objects.equals(unique_gift, message.unique_gift) &&
656+
Objects.equals(gift_upgrade_sent, message.gift_upgrade_sent) &&
651657
Objects.equals(paid_message_price_changed, message.paid_message_price_changed) &&
652658
Objects.equals(suggested_post_approved, message.suggested_post_approved) &&
653659
Objects.equals(suggested_post_approval_failed, message.suggested_post_approval_failed) &&
@@ -760,6 +766,7 @@ public String toString() {
760766
", web_app_data=" + web_app_data +
761767
", gift=" + gift +
762768
", unique_gift=" + unique_gift +
769+
", gift_upgrade_sent=" + gift_upgrade_sent +
763770
", paid_message_price_changed=" + paid_message_price_changed +
764771
", suggested_post_approved=" + suggested_post_approved +
765772
", suggested_post_approval_failed=" + suggested_post_approval_failed +

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ public class Story implements Serializable {
1313
private final static long serialVersionUID = 0L;
1414

1515
private Chat chat;
16-
private Integer id;
16+
private Long id;
1717

1818
public Chat chat() {
1919
return chat;
2020
}
2121

22-
public Integer id() {
22+
public Long id() {
2323
return id;
2424
}
2525

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class User implements Serializable {
2323
private Boolean supports_inline_queries;
2424
private Boolean can_connect_to_business;
2525
private Boolean has_main_web_app;
26+
private Boolean has_topics_enabled;
2627

2728
private User() {
2829
}
@@ -83,12 +84,16 @@ public Boolean hasMainWebApp() {
8384
return has_main_web_app;
8485
}
8586

87+
public Boolean hasTopicsEnabled() {
88+
return has_topics_enabled;
89+
}
90+
8691
@Override
8792
public boolean equals(Object o) {
8893
if (this == o) return true;
8994
if (o == null || getClass() != o.getClass()) return false;
9095
User user = (User) o;
91-
return Objects.equals(id, user.id) && Objects.equals(is_bot, user.is_bot) && Objects.equals(first_name, user.first_name) && Objects.equals(last_name, user.last_name) && Objects.equals(username, user.username) && Objects.equals(language_code, user.language_code) && Objects.equals(is_premium, user.is_premium) && Objects.equals(added_to_attachment_menu, user.added_to_attachment_menu) && Objects.equals(can_join_groups, user.can_join_groups) && Objects.equals(can_read_all_group_messages, user.can_read_all_group_messages) && Objects.equals(supports_inline_queries, user.supports_inline_queries) && Objects.equals(can_connect_to_business, user.can_connect_to_business) && Objects.equals(has_main_web_app, user.has_main_web_app);
96+
return Objects.equals(id, user.id) && Objects.equals(is_bot, user.is_bot) && Objects.equals(first_name, user.first_name) && Objects.equals(last_name, user.last_name) && Objects.equals(username, user.username) && Objects.equals(language_code, user.language_code) && Objects.equals(is_premium, user.is_premium) && Objects.equals(added_to_attachment_menu, user.added_to_attachment_menu) && Objects.equals(can_join_groups, user.can_join_groups) && Objects.equals(can_read_all_group_messages, user.can_read_all_group_messages) && Objects.equals(supports_inline_queries, user.supports_inline_queries) && Objects.equals(can_connect_to_business, user.can_connect_to_business) && Objects.equals(has_main_web_app, user.has_main_web_app) && Objects.equals(has_topics_enabled, user.has_topics_enabled);
9297
}
9398

9499
@Override
@@ -112,6 +117,7 @@ public String toString() {
112117
", supports_inline_queries=" + supports_inline_queries +
113118
", can_connect_to_business=" + can_connect_to_business +
114119
", has_main_web_app=" + has_main_web_app +
120+
", has_topics_enabled=" + has_topics_enabled +
115121
'}';
116122
}
117123
}
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+
data class UserRating(
4+
@get:JvmName("level") val level: Int,
5+
@get:JvmName("rating") val rating: Int,
6+
@get:JvmName("currentLevelRating") val currentLevelRating: Int,
7+
@get:JvmName("nextLevelRating") val nextLevelRating: Int? = null
8+
)

0 commit comments

Comments
 (0)