Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0bafde1
Added the classes RichText, RichTextBold, RichTextItalic, RichTextUnd…
mircoianese Jun 11, 2026
ebb7218
Added the class RichBlockCaption, which represents the caption of a r…
mircoianese Jun 11, 2026
4858fac
Added the class RichBlockTableCell, which represents a cell in a table.
mircoianese Jun 11, 2026
fad2fe7
Added the classes RichBlock, RichBlockParagraph, RichBlockSectionHead…
mircoianese Jun 11, 2026
8684269
Register RichText and RichBlock adapters
mircoianese Jun 11, 2026
885275a
Added the class RichMessage, which represents a rich formatted message.
mircoianese Jun 11, 2026
f542803
Added the field rich_message to the class Message.
mircoianese Jun 11, 2026
6548bb3
Added the classes InputRichMessage and InputRichMessageContent
mircoianese Jun 11, 2026
db07de9
Added the method sendRichMessage, allowing bots to send rich messages.
mircoianese Jun 11, 2026
19f2b56
Added the method sendRichMessageDraft, allowing bots to stream partia…
mircoianese Jun 11, 2026
5c7a8b5
Added the parameter rich_message to the method editMessageText, allow…
mircoianese Jun 11, 2026
7d4b211
Added the field supports_join_request_queries to the class User.
mircoianese Jun 11, 2026
51b235d
Added the field guard_bot to the class ChatFullInfo.
mircoianese Jun 11, 2026
f37fab7
Added the field query_id to the class ChatJoinRequest.
mircoianese Jun 11, 2026
dee414c
Added the method answerChatJoinRequestQuery.
mircoianese Jun 11, 2026
59fb8f3
Added the method sendChatJoinRequestWebApp.
mircoianese Jun 11, 2026
681e4bf
Added the class Link and the field link to the class PollMedia.
mircoianese Jun 11, 2026
bcb5d15
Added the class InputMediaLink and allowed it to be used as InputPoll…
mircoianese Jun 11, 2026
043e8b7
v10.1
mircoianese Jun 11, 2026
7a012d8
EditMessageText: add constructors for InputRichMessage
mircoianese Jun 11, 2026
94161df
Updated all timestamp fields from Integer to Long (since are unix tim…
mircoianese Jun 11, 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 10.0 methods
- Full support of all Bot API 10.1 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:10.0.0'
implementation 'com.github.pengrad:java-telegram-bot-api:10.1.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.pengrad</groupId>
<artifactId>java-telegram-bot-api</artifactId>
<version>10.0.0</version>
<version>10.1.0</version>
</dependency>
```
[JAR with all dependencies on release page](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=10.0.0
VERSION_NAME=10.1.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 @@ -51,7 +51,7 @@ public enum Type {
private Integer profile_accent_color_id;
private String profile_background_custom_emoji_id;
private String emoji_status_custom_emoji_id;
private Integer emoji_status_expiration_date;
private Long emoji_status_expiration_date;
private String bio;
private Boolean has_private_forwards;
private Boolean has_restricted_voice_and_video_messages;
Expand Down Expand Up @@ -79,6 +79,7 @@ public enum Type {
private Integer paid_message_star_count;
private UniqueGiftColors unique_gift_colors;
private Audio first_profile_audio;
private User guard_bot;

public Long id() {
return id;
Expand Down Expand Up @@ -172,7 +173,7 @@ public String emojiStatusCustomEmojiId() {
return emoji_status_custom_emoji_id;
}

public Integer emojiStatusExpirationDate() {
public Long emojiStatusExpirationDate() {
return emoji_status_expiration_date;
}

Expand Down Expand Up @@ -283,6 +284,10 @@ public Audio firstProfileAudio() {
return first_profile_audio;
}

public User guardBot() {
return guard_bot;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down Expand Up @@ -338,7 +343,8 @@ public boolean equals(Object o) {
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) &&
Objects.equals(first_profile_audio, chat.first_profile_audio);
Objects.equals(first_profile_audio, chat.first_profile_audio) &&
Objects.equals(guard_bot, chat.guard_bot);
}

@Override
Expand Down Expand Up @@ -400,6 +406,7 @@ public String toString() {
", paid_message_star_count=" + paid_message_star_count +
", unique_gift_colors=" + unique_gift_colors +
", first_profile_audio=" + first_profile_audio +
", guard_bot=" + guard_bot +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ChatInviteLink implements Serializable {
private Boolean is_primary;
private Boolean is_revoked;
private String name;
private Integer expire_date;
private Long expire_date;
private Integer member_limit;
private Integer pending_join_request_count;

Expand Down Expand Up @@ -45,7 +45,7 @@ public String name() {
return name;
}

public Integer expireDate() {
public Long expireDate() {
return expire_date;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ public class ChatJoinRequest implements Serializable {
private Chat chat;
private User from;
private Long user_chat_id;
private Integer date;
private Long date;
private String bio;
private ChatInviteLink invite_link;
private String query_id;

public Chat chat() {
return chat;
Expand All @@ -29,7 +30,7 @@ public Long userChatId() {
return user_chat_id;
}

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

Expand All @@ -41,6 +42,9 @@ public ChatInviteLink inviteLink() {
return invite_link;
}

public String queryId() {
return query_id;
}

@Override
public boolean equals(Object o) {
Expand All @@ -52,12 +56,13 @@ public boolean equals(Object o) {
Objects.equals(user_chat_id, that.user_chat_id) &&
Objects.equals(date, that.date) &&
Objects.equals(bio, that.bio) &&
Objects.equals(invite_link, that.invite_link);
Objects.equals(invite_link, that.invite_link) &&
Objects.equals(query_id, that.query_id);
}

@Override
public int hashCode() {
return Objects.hash(chat, from, user_chat_id, date, bio, invite_link);
return Objects.hash(chat, from, user_chat_id, date, bio, invite_link, query_id);
}

@Override
Expand All @@ -69,6 +74,7 @@ public String toString() {
", date=" + date +
", bio=" + bio +
", invite_link=" + invite_link +
", query_id=" + query_id +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum Status {

private String custom_title;
private Boolean is_anonymous;
private Integer until_date;
private Long until_date;
private Boolean can_be_edited;
private Boolean can_manage_chat;
private Boolean can_post_messages;
Expand Down Expand Up @@ -70,7 +70,7 @@ public Boolean isAnonymous() {
return is_anonymous != null && is_anonymous;
}

public Integer untilDate() {
public Long untilDate() {
return until_date;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ChatMemberUpdated implements Serializable {

private Chat chat;
private User from;
private Integer date;
private Long date;
private ChatMember old_chat_member;
private ChatMember new_chat_member;
private ChatInviteLink invite_link;
Expand All @@ -27,7 +27,7 @@ public User from() {
return from;
}

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

Expand Down
5 changes: 5 additions & 0 deletions library/src/main/java/com/pengrad/telegrambot/model/Link.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.pengrad.telegrambot.model

data class Link(
@get:JvmName("url") val url: String,
)
14 changes: 11 additions & 3 deletions library/src/main/java/com/pengrad/telegrambot/model/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.pengrad.telegrambot.model.message.origin.*;
import com.pengrad.telegrambot.model.paidmedia.PaidMediaInfo;
import com.pengrad.telegrambot.model.request.InlineKeyboardMarkup;
import com.pengrad.telegrambot.model.richmessages.RichMessage;
import com.pengrad.telegrambot.model.stars.DirectMessagePriceChanged;
import com.pengrad.telegrambot.model.stars.PaidMessagePriceChanged;
import com.pengrad.telegrambot.model.suggestedposts.*;
Expand Down Expand Up @@ -50,7 +51,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
private Story reply_to_story;
private Integer reply_to_checklist_task_id;
private User via_bot;
private Integer edit_date;
private Long edit_date;
private Boolean has_protected_content;
private Boolean is_from_offline;
private Boolean is_paid_post;
Expand All @@ -64,6 +65,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
private LinkPreviewOptions link_preview_options;
private SuggestedPostInfo suggested_post_info;
private String effect_id;
private RichMessage rich_message;
private Audio audio;
private PaidMediaInfo paid_media;
private Document document;
Expand Down Expand Up @@ -213,7 +215,7 @@ public User viaBot() {
return via_bot;
}

public Integer editDate() {
public Long editDate() {
return edit_date;
}

Expand Down Expand Up @@ -270,6 +272,10 @@ public String effectId() {
return effect_id;
}

public RichMessage richMessage() {
return rich_message;
}

public Audio audio() {
return audio;
}
Expand Down Expand Up @@ -607,7 +613,7 @@ void setMessageId(Integer messageId) {
/**
* Only for backwards-compatibility with MaybeInaccessibleMessage
*/
void setDate(Integer date) {
void setDate(Long date) {
this.date = date;
}

Expand Down Expand Up @@ -650,6 +656,7 @@ public boolean equals(Object o) {
Objects.equals(link_preview_options, message.link_preview_options) &&
Objects.equals(suggested_post_info, message.suggested_post_info) &&
Objects.equals(effect_id, message.effect_id) &&
Objects.equals(rich_message, message.rich_message) &&
Objects.equals(audio, message.audio) &&
Objects.equals(paid_media, message.paid_media) &&
Objects.equals(document, message.document) &&
Expand Down Expand Up @@ -774,6 +781,7 @@ public String toString() {
", link_preview_options=" + link_preview_options +
", suggested_post_info=" + suggested_post_info +
", effect_id=" + effect_id +
", rich_message=" + rich_message +
", audio=" + audio +
", paid_media=" + paid_media +
", document=" + document +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public enum Type {
private User user;
private String language;
private String custom_emoji_id;
private Integer unix_time;
private Long unix_time;
private String date_time_format;

private MessageEntity() {
Expand Down Expand Up @@ -62,7 +62,7 @@ public String customEmojiId() {
return custom_emoji_id;
}

public Integer unixTime() {
public Long unixTime() {
return unix_time;
}

Expand Down Expand Up @@ -90,7 +90,7 @@ public MessageEntity customEmojiId(String custom_emoji_id) {
return this;
}

public MessageEntity unixTime(Integer unix_time) {
public MessageEntity unixTime(Long unix_time) {
this.unix_time = unix_time;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class MessageReactionCountUpdated {

private Chat chat;
private Integer message_id;
private Integer date;
private Long date;
private ReactionCount[] reactions;

public Chat chat() {
Expand All @@ -20,7 +20,7 @@ public Integer messageId() {
return message_id;
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class MessageReactionUpdated {
private Integer message_id;
private User user;
private Chat actor_chat;
private Integer date;
private Long date;
private ReactionType[] old_reaction;
private ReactionType[] new_reaction;

Expand All @@ -31,7 +31,7 @@ public Chat actorChat() {
return actor_chat;
}

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

Expand Down
4 changes: 2 additions & 2 deletions library/src/main/java/com/pengrad/telegrambot/model/Poll.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum Type {
private String explanation;
private MessageEntity[] explanation_entities;
private Integer open_period;
private Integer close_date;
private Long close_date;
private String description;
private MessageEntity[] description_entities;
private PollMedia media;
Expand Down Expand Up @@ -96,7 +96,7 @@ public Integer openPeriod() {
return open_period;
}

public Integer closeDate() {
public Long closeDate() {
return close_date;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data class PollMedia(
@get:JvmName("sticker") val sticker: Sticker? = null,
@get:JvmName("venue") val venue: Venue? = null,
@get:JvmName("video") val video: Video? = null,
@get:JvmName("link") val link: Link? = null,
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand All @@ -22,7 +23,8 @@ data class PollMedia(
photo contentEquals other.photo &&
sticker == other.sticker &&
venue == other.venue &&
video == other.video
video == other.video &&
link == other.link
}

override fun hashCode(): Int {
Expand All @@ -35,6 +37,7 @@ data class PollMedia(
result = 31 * result + (sticker?.hashCode() ?: 0)
result = 31 * result + (venue?.hashCode() ?: 0)
result = 31 * result + (video?.hashCode() ?: 0)
result = 31 * result + (link?.hashCode() ?: 0)
return result
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class PollOption implements Serializable {
private MessageEntity[] text_entities;
private User added_by_user;
private Chat added_by_chat;
private Integer addition_date;
private Long addition_date;
private PollMedia media;

public String persistentId() {
Expand All @@ -44,7 +44,7 @@ public Chat addedByChat() {
return added_by_chat;
}

public Integer additionDate() {
public Long additionDate() {
return addition_date;
}

Expand Down
Loading
Loading