Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d398aff
Added the field has_topics_enabled to the class User, which can be us…
mircoianese Jan 3, 2026
dcb6207
Added the method sendMessageDraft, allowing partial messages to be st…
mircoianese Jan 3, 2026
6f337a0
message_thread_id converted to Long for safety
mircoianese Jan 3, 2026
f1abd84
Added the field is_name_implicit to the classes ForumTopic and ForumT…
mircoianese Jan 3, 2026
e4f874d
Added the methods getUserGifts and getChatGifts
mircoianese Jan 3, 2026
fbeff58
Replaced the field last_resale_star_count with the fields last_resale…
mircoianese Jan 3, 2026
f3cb107
Replaced the parameter exclude_limited with the parameters exclude_li…
mircoianese Jan 3, 2026
c7e7e8e
Added the field gift_upgrade_sent to the class Message
mircoianese Jan 3, 2026
74433d5
Added the field gift_id to the class UniqueGift
mircoianese Jan 3, 2026
1aa149a
Added the field is_from_blockchain to the class UniqueGift
mircoianese Jan 3, 2026
663844f
Added the fields personal_total_count and personal_remaining_count to…
mircoianese Jan 3, 2026
7c7ccb6
Added the field is_premium to the classes Gift and UniqueGift
mircoianese Jan 3, 2026
def3d30
Added the field is_upgrade_separate to the classes GiftInfo and Owned…
mircoianese Jan 3, 2026
9548823
Added the class UniqueGiftColors that describes the color scheme for …
mircoianese Jan 3, 2026
d80edb2
Added the field has_colors to the class Gift
mircoianese Jan 3, 2026
2d9961a
Added the field colors to the class UniqueGift
mircoianese Jan 3, 2026
f7d3e83
Added the class GiftBackground and the field background to the class …
mircoianese Jan 3, 2026
5bf653e
Added the field unique_gift_variant_count to the class Gift
mircoianese Jan 3, 2026
0034816
Added the field unique_gift_number to the classes GiftInfo and OwnedG…
mircoianese Jan 3, 2026
1413ea1
Added the field gifts_from_channels to the class AcceptedGiftTypes
mircoianese Jan 3, 2026
9ff6607
Added the method repostStory, allowing bots to repost stories across …
mircoianese Jan 3, 2026
817c452
ID parameter for Stories updated from Integer to Long for safety
mircoianese Jan 3, 2026
211678a
Added the class UserRating and the field rating to the class ChatFull…
mircoianese Jan 3, 2026
5c7fc2d
Added the field paid_message_star_count to the class ChatFullInfo
mircoianese Jan 3, 2026
81d8aea
Added the parameter message_effect_id to the methods forwardMessage a…
mircoianese Jan 3, 2026
0eb0681
Added the field unique_gift_colors to the class ChatFullInfo
mircoianese Jan 3, 2026
d9aad7d
Added the field completed_by_chat to the class ChecklistTask
mircoianese Jan 3, 2026
fd8259b
Bump version to 9.3.0
mircoianese Jan 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![codecov](https://codecov.io/gh/pengrad/java-telegram-bot-api/branch/master/graph/badge.svg)](https://codecov.io/gh/pengrad/java-telegram-bot-api)

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

Gradle:
```groovy
implementation 'com.github.pengrad:java-telegram-bot-api:9.2.1'
implementation 'com.github.pengrad:java-telegram-bot-api:9.3.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.pengrad</groupId>
<artifactId>java-telegram-bot-api</artifactId>
<version>9.2.1</version>
<version>9.3.0</version>
</dependency>
```
[JAR with all dependencies on release page](https://github.com/pengrad/java-telegram-bot-api/releases)
Expand Down
6 changes: 3 additions & 3 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![codecov](https://codecov.io/gh/pengrad/java-telegram-bot-api/branch/master/graph/badge.svg)](https://codecov.io/gh/pengrad/java-telegram-bot-api)

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

Gradle:
```groovy
implementation 'com.github.pengrad:java-telegram-bot-api:9.2.1'
implementation 'com.github.pengrad:java-telegram-bot-api:9.3.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.pengrad</groupId>
<artifactId>java-telegram-bot-api</artifactId>
<version>9.2.1</version>
<version>9.3.0</version>
</dependency>
```
Также JAR со всеми зависимостями можно найти [в релизах](https://github.com/pengrad/java-telegram-bot-api/releases).
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.github.pengrad
VERSION_NAME=9.2.1
VERSION_NAME=9.3.0

POM_DESCRIPTION=Java API for Telegram Bot API
POM_URL=https://github.com/pengrad/java-telegram-bot-api/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.pengrad.telegrambot.model.business.BusinessLocation;
import com.pengrad.telegrambot.model.business.BusinessOpeningHours;
import com.pengrad.telegrambot.model.gift.AcceptedGiftTypes;
import com.pengrad.telegrambot.model.gift.unique.UniqueGiftColors;
import com.pengrad.telegrambot.model.reaction.ReactionType;


Expand Down Expand Up @@ -75,6 +76,9 @@ public enum Type {
private ChatLocation location;
private Boolean can_send_gift;
private AcceptedGiftTypes accepted_gift_types;
private UserRating rating;
private Integer paid_message_star_count;
private UniqueGiftColors unique_gift_colors;

public Long id() {
return id;
Expand Down Expand Up @@ -272,6 +276,18 @@ public AcceptedGiftTypes acceptedGiftTypes() {
return accepted_gift_types;
}

public UserRating rating() {
return rating;
}

public Integer paidMessageStarCount() {
return paid_message_star_count;
}

public UniqueGiftColors uniqueGiftColors() {
return unique_gift_colors;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down Expand Up @@ -323,7 +339,10 @@ public boolean equals(Object o) {
Objects.equals(custom_emoji_sticker_set_name, chat.custom_emoji_sticker_set_name) &&
Objects.equals(linked_chat_id, chat.linked_chat_id) &&
Objects.equals(location, chat.location) &&
Objects.equals(accepted_gift_types, chat.accepted_gift_types);
Objects.equals(accepted_gift_types, chat.accepted_gift_types) &&
Objects.equals(rating, chat.rating) &&
Objects.equals(paid_message_star_count, chat.paid_message_star_count) &&
Objects.equals(unique_gift_colors, chat.unique_gift_colors);
}

@Override
Expand Down Expand Up @@ -381,6 +400,9 @@ public String toString() {
", linked_chat_id=" + linked_chat_id +
", location=" + location +
", accepted_gift_types=" + accepted_gift_types +
", rating=" + rating +
", paid_message_star_count=" + paid_message_star_count +
", unique_gift_colors=" + unique_gift_colors +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
public class ForumTopic implements Serializable {
private final static long serialVersionUID = 0L;

private Integer message_thread_id;
private Long message_thread_id;
private String name;
private Integer icon_color;
private String icon_custom_emoji_id;
private Boolean is_name_implicit;

public Integer messageThreadId() {
public Long messageThreadId() {
return message_thread_id;
}

Expand All @@ -27,6 +28,10 @@ public String iconCustomEmojiId() {
return icon_custom_emoji_id;
}

public Boolean isNameImplicit() {
return is_name_implicit;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -37,15 +42,17 @@ public boolean equals(Object o) {
return Objects.equals(message_thread_id, that.message_thread_id) &&
Objects.equals(name, that.name) &&
Objects.equals(icon_color, that.icon_color) &&
Objects.equals(icon_custom_emoji_id, that.icon_custom_emoji_id);
Objects.equals(icon_custom_emoji_id, that.icon_custom_emoji_id) &&
Objects.equals(is_name_implicit, that.is_name_implicit);
}

@Override
public int hashCode() {
return Objects.hash(message_thread_id,
name,
icon_color,
icon_custom_emoji_id);
icon_custom_emoji_id,
is_name_implicit);
}

@Override
Expand All @@ -55,6 +62,7 @@ public String toString() {
", name='" + name + '\'' +
", icon_color=" + icon_color +
", icon_custom_emoji_id='" + icon_custom_emoji_id + '\'' +
", is_name_implicit=" + is_name_implicit +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class ForumTopicCreated implements Serializable {
private String name;
private Integer icon_color;
private String icon_custom_emoji_id;
private Boolean is_name_implicit;

public String name() {
return name;
Expand All @@ -22,6 +23,10 @@ public String iconCustomEmojiId() {
return icon_custom_emoji_id;
}

public Boolean isNameImplicit() {
return is_name_implicit;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -31,14 +36,16 @@ public boolean equals(Object o) {

return Objects.equals(name, that.name) &&
Objects.equals(icon_color, that.icon_color) &&
Objects.equals(icon_custom_emoji_id, that.icon_custom_emoji_id);
Objects.equals(icon_custom_emoji_id, that.icon_custom_emoji_id) &&
Objects.equals(is_name_implicit, that.is_name_implicit);
}

@Override
public int hashCode() {
return Objects.hash(name,
icon_color,
icon_custom_emoji_id);
icon_custom_emoji_id,
is_name_implicit);
}

@Override
Expand All @@ -47,6 +54,7 @@ public String toString() {
"name='" + name + '\'' +
", icon_color=" + icon_color +
", icon_custom_emoji_id='" + icon_custom_emoji_id + '\'' +
", is_name_implicit=" + is_name_implicit +
'}';
}
}
11 changes: 9 additions & 2 deletions library/src/main/java/com/pengrad/telegrambot/model/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class Message extends MaybeInaccessibleMessage implements Serializable {
private final static long serialVersionUID = 0L;

private Integer message_thread_id;
private Long message_thread_id;
private DirectMessagesTopic direct_messages_topic;
private User from;
private Chat sender_chat;
Expand Down Expand Up @@ -122,6 +122,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
private WebAppData web_app_data;
private GiftInfo gift;
private UniqueGiftInfo unique_gift;
private GiftInfo gift_upgrade_sent;
private PaidMessagePriceChanged paid_message_price_changed;
private SuggestedPostApproved suggested_post_approved;
private SuggestedPostApprovalFailed suggested_post_approval_failed;
Expand All @@ -131,7 +132,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
private DirectMessagePriceChanged direct_message_price_changed;
private Integer paid_star_count;

public Integer messageThreadId() {
public Long messageThreadId() {
return message_thread_id;
}

Expand Down Expand Up @@ -496,6 +497,10 @@ public UniqueGiftInfo uniqueGift() {
return unique_gift;
}

public GiftInfo giftUpgradeSent() {
return gift_upgrade_sent;
}

public PaidMessagePriceChanged paidMessagePriceChanged() {
return paid_message_price_changed;
}
Expand Down Expand Up @@ -648,6 +653,7 @@ public boolean equals(Object o) {
Objects.equals(web_app_data, message.web_app_data) &&
Objects.equals(gift, message.gift) &&
Objects.equals(unique_gift, message.unique_gift) &&
Objects.equals(gift_upgrade_sent, message.gift_upgrade_sent) &&
Objects.equals(paid_message_price_changed, message.paid_message_price_changed) &&
Objects.equals(suggested_post_approved, message.suggested_post_approved) &&
Objects.equals(suggested_post_approval_failed, message.suggested_post_approval_failed) &&
Expand Down Expand Up @@ -760,6 +766,7 @@ public String toString() {
", web_app_data=" + web_app_data +
", gift=" + gift +
", unique_gift=" + unique_gift +
", gift_upgrade_sent=" + gift_upgrade_sent +
", paid_message_price_changed=" + paid_message_price_changed +
", suggested_post_approved=" + suggested_post_approved +
", suggested_post_approval_failed=" + suggested_post_approval_failed +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public class Story implements Serializable {
private final static long serialVersionUID = 0L;

private Chat chat;
private Integer id;
private Long id;

public Chat chat() {
return chat;
}

public Integer id() {
public Long id() {
return id;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class User implements Serializable {
private Boolean supports_inline_queries;
private Boolean can_connect_to_business;
private Boolean has_main_web_app;
private Boolean has_topics_enabled;

private User() {
}
Expand Down Expand Up @@ -83,12 +84,16 @@ public Boolean hasMainWebApp() {
return has_main_web_app;
}

public Boolean hasTopicsEnabled() {
return has_topics_enabled;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
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);
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);
}

@Override
Expand All @@ -112,6 +117,7 @@ public String toString() {
", supports_inline_queries=" + supports_inline_queries +
", can_connect_to_business=" + can_connect_to_business +
", has_main_web_app=" + has_main_web_app +
", has_topics_enabled=" + has_topics_enabled +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.pengrad.telegrambot.model

data class UserRating(
@get:JvmName("level") val level: Int,
@get:JvmName("rating") val rating: Int,
@get:JvmName("currentLevelRating") val currentLevelRating: Int,
@get:JvmName("nextLevelRating") val nextLevelRating: Int? = null
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pengrad.telegrambot.model.checklist

import com.pengrad.telegrambot.model.Chat
import com.pengrad.telegrambot.model.MessageEntity
import com.pengrad.telegrambot.model.User

Expand All @@ -9,6 +10,7 @@ data class ChecklistTask(
@get:JvmName("text") val text: String,
@get:JvmName("textEntities") val textEntities: Array<MessageEntity>?,
@get:JvmName("completedByUser") val completedByUser: User?,
@get:JvmName("completedByChat") val completedByChat: Chat? = null,
@get:JvmName("completionDate") val completionDate: Int?

) {
Expand All @@ -21,6 +23,7 @@ data class ChecklistTask(
text == other.text &&
textEntities contentEquals other.textEntities &&
completedByUser == other.completedByUser &&
completedByChat == other.completedByChat &&
completionDate == other.completionDate
}

Expand All @@ -29,6 +32,7 @@ data class ChecklistTask(
result = 31 * result + (text?.hashCode() ?: 0)
result = 31 * result + (textEntities?.contentHashCode() ?: 0)
result = 31 * result + (completedByUser?.hashCode() ?: 0)
result = 31 * result + (completedByChat?.hashCode() ?: 0)
result = 31 * result + (completionDate?.hashCode() ?: 0)
return result
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ data class AcceptedGiftTypes(
@get:JvmName("unlimitedGifts") val unlimitedGifts: Boolean,
@get:JvmName("limitedGifts") val limitedGifts: Boolean,
@get:JvmName("uniqueGifts") val uniqueGifts: Boolean,
@get:JvmName("premiumSubscription") val premiumSubscription: Boolean
@get:JvmName("premiumSubscription") val premiumSubscription: Boolean,
@get:JvmName("giftsFromChannels") val giftsFromChannels: Boolean
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ data class Gift(
@get:JvmName("upgradeStarCount") val upgradeStarCount: Int? = null,
@get:JvmName("totalCount") val totalCount: Int? = null,
@get:JvmName("remainingCount") val remainingCount: Int? = null,
@get:JvmName("personalTotalCount") val personalTotalCount: Int? = null,
@get:JvmName("personalRemainingCount") val personalRemainingCount: Int? = null,
@get:JvmName("isPremium") val isPremium: Boolean? = null,
@get:JvmName("hasColors") val hasColors: Boolean? = null,
@get:JvmName("background") val background: GiftBackground? = null,
@get:JvmName("uniqueGiftVariantCount") val uniqueGiftVariantCount: Int? = null,
@get:JvmName("publisherChat") val publisherChat: Chat? = null
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.pengrad.telegrambot.model.gift

data class GiftBackground(
@get:JvmName("centerColor") val centerColor: Int,
@get:JvmName("edgeColor") val edgeColor: Int,
@get:JvmName("textColor") val textColor: Int
)
Loading
Loading