Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ad248cb
Added the class InputRichMessageMedia and the field media to the clas…
mircoianese Aug 25, 2026
c79a5e5
Added the class InputMediaVoiceNote, representing a voice message to …
mircoianese Aug 25, 2026
12fd774
RichText: add serialization support
mircoianese Aug 25, 2026
ba69b16
Added the classes InputRichBlockListItem, InputRichBlockParagraph, In…
mircoianese Aug 25, 2026
447a72c
multipart upload support for rich message media
mircoianese Aug 25, 2026
8b3a8c0
Added the field blocks to the class InputRichMessage, allowing bots t…
mircoianese Aug 25, 2026
4856d63
Added the field is_ephemeral to the class BotCommand
mircoianese Aug 25, 2026
18b61a3
Added the field receiver_user to the class Message
mircoianese Aug 25, 2026
550bf07
Added the field ephemeral_message_id to the class Message
mircoianese Aug 25, 2026
3008cb2
Added the field ephemeral_message_id to the class ReplyParameters, al…
mircoianese Aug 25, 2026
a4b7a39
Added the methods editEphemeralMessageText, editEphemeralMessageMedia…
mircoianese Aug 25, 2026
18aba1c
Added the method deleteEphemeralMessage allowing bots to delete ephem…
mircoianese Aug 25, 2026
9deeaa1
Added the class Community which represents a community
mircoianese Aug 25, 2026
1f02701
Added the class CommunityChatAdded and the field community_chat_added…
mircoianese Aug 25, 2026
375b640
Added the class CommunityChatRemoved and the field community_chat_rem…
mircoianese Aug 25, 2026
d8de874
Added the field community to the class ChatFullInfo
mircoianese Aug 25, 2026
9674ee0
Added updates about changes to a user payment subscription, represent…
mircoianese Aug 25, 2026
746b644
Added missing Kotlin methods extensions
mircoianese Aug 25, 2026
d63f366
Added missing Location constructor
mircoianese Aug 25, 2026
62b5a31
Bump version to 10.2
mircoianese Aug 25, 2026
0130e05
Added the class DisabledButton and the field disabled to the class In…
mircoianese Aug 25, 2026
8ae80f0
Added the class RichMessageButton representing a button in a RichMessage
mircoianese Aug 25, 2026
18adcfe
Added the class RichTextButton
mircoianese Aug 25, 2026
10a5c23
Added the classes RichBlockButtons and InputRichBlockButtons
mircoianese Aug 25, 2026
99a74ab
Added the field is_compact to the class RichBlockTable
mircoianese Aug 25, 2026
ff8ab91
Added the classes RichBlockExpandableBlockQuotation and InputRichBloc…
mircoianese Aug 25, 2026
b054690
Added the classes RichBlockDocument and InputRichBlockDocument, conta…
mircoianese Aug 25, 2026
4f5a875
Added the class EphemeralMessageParameters
mircoianese Aug 25, 2026
e26b277
Added the parameter ephemeral_message_parameters to the method sendRi…
mircoianese Aug 25, 2026
c3d6e6d
Added the field can_send_welcome_messages to the classes ChatMember a…
mircoianese Aug 25, 2026
af90957
Added the parameter can_send_welcome_messages to the method promoteCh…
mircoianese Aug 25, 2026
92bac23
Added the field force_reply to the classes InlineKeyboardMarkup and R…
mircoianese Aug 25, 2026
6e35cb0
Added the parameters can_stop and keep_on_stop to the methods sendMes…
mircoianese Aug 25, 2026
ca17bef
Added updates about user stopping message generation, represented by …
mircoianese Aug 25, 2026
47a9734
Added the class CommunityChatJoined and the field community_chat_join…
mircoianese Aug 25, 2026
c253b8f
Added the fields text, entities and is_private to the class UniqueGif…
mircoianese Aug 25, 2026
356a96a
Bump version to 10.3
mircoianese Aug 25, 2026
39ecfe5
Fix tests
mircoianese Aug 25, 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.1 methods
- Full support of all Bot API 10.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:10.1.0'
implementation 'com.github.pengrad:java-telegram-bot-api:10.3.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.pengrad</groupId>
<artifactId>java-telegram-bot-api</artifactId>
<version>10.1.0</version>
<version>10.3.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.1.0
VERSION_NAME=10.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 @@ -18,6 +18,7 @@ public BotCommand(String command, String description) {

private String command;
private String description;
private Boolean is_ephemeral;

public String command() {
return command;
Expand All @@ -27,6 +28,15 @@ public String description() {
return description;
}

public Boolean isEphemeral() {
return is_ephemeral;
}

public BotCommand isEphemeral(Boolean isEphemeral) {
this.is_ephemeral = isEphemeral;
return this;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -35,13 +45,15 @@ public boolean equals(Object o) {
BotCommand that = (BotCommand) o;

if (command != null ? !command.equals(that.command) : that.command != null) return false;
return description != null ? description.equals(that.description) : that.description == null;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
return is_ephemeral != null ? is_ephemeral.equals(that.is_ephemeral) : that.is_ephemeral == null;
}

@Override
public int hashCode() {
int result = command != null ? command.hashCode() : 0;
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + (is_ephemeral != null ? is_ephemeral.hashCode() : 0);
return result;
}

Expand All @@ -50,6 +62,7 @@ public String toString() {
return "BotCommand{" +
"command='" + command + '\'' +
", description='" + description + '\'' +
", is_ephemeral=" + is_ephemeral +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.pengrad.telegrambot.model

import java.io.Serializable

data class BotSubscriptionUpdated(
@get:JvmName("user") val user: User,
@get:JvmName("invoicePayload") val invoicePayload: String,
@get:JvmName("state") val state: String,
) : Serializable
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ChatAdministratorRights implements Serializable {
private Boolean can_manage_topics;
private Boolean can_manage_direct_messages;
private Boolean can_manage_tags;
private Boolean can_send_welcome_messages;

public Boolean isAnonymous() {
return is_anonymous != null && is_anonymous;
Expand Down Expand Up @@ -97,6 +98,10 @@ public Boolean canManageTags() {
return can_manage_tags != null && can_manage_tags;
}

public Boolean canSendWelcomeMessages() {
return can_send_welcome_messages != null && can_send_welcome_messages;
}

public ChatAdministratorRights canManageChat(boolean canManageChat) {
this.can_manage_chat = canManageChat;
return this;
Expand Down Expand Up @@ -177,6 +182,11 @@ public ChatAdministratorRights canManageTags(boolean canManageTags) {
return this;
}

public ChatAdministratorRights canSendWelcomeMessages(boolean canSendWelcomeMessages) {
this.can_send_welcome_messages = canSendWelcomeMessages;
return this;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -199,7 +209,8 @@ public boolean equals(Object o) {
Objects.equals(can_delete_stories, that.can_delete_stories) &&
Objects.equals(can_manage_topics, that.can_manage_topics) &&
Objects.equals(can_manage_direct_messages, that.can_manage_direct_messages) &&
Objects.equals(can_manage_tags, that.can_manage_tags);
Objects.equals(can_manage_tags, that.can_manage_tags) &&
Objects.equals(can_send_welcome_messages, that.can_send_welcome_messages);
}

@Override
Expand All @@ -220,7 +231,8 @@ public int hashCode() {
can_delete_stories,
can_manage_topics,
can_manage_direct_messages,
can_manage_tags);
can_manage_tags,
can_send_welcome_messages);
}

@Override
Expand All @@ -243,6 +255,7 @@ public String toString() {
", can_manage_topics=" + can_manage_topics +
", can_manage_direct_messages=" + can_manage_direct_messages +
", can_manage_tags=" + can_manage_tags +
", can_send_welcome_messages=" + can_send_welcome_messages +
'}';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public enum Type {
private UniqueGiftColors unique_gift_colors;
private Audio first_profile_audio;
private User guard_bot;
private Community community;

public Long id() {
return id;
Expand Down Expand Up @@ -288,6 +289,10 @@ public User guardBot() {
return guard_bot;
}

public Community community() {
return community;
}

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

@Override
Expand Down Expand Up @@ -407,6 +413,7 @@ public String toString() {
", unique_gift_colors=" + unique_gift_colors +
", first_profile_audio=" + first_profile_audio +
", guard_bot=" + guard_bot +
", community=" + community +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public enum Status {
private Boolean can_manage_topics;
private Boolean can_manage_direct_messages;
private Boolean can_manage_tags;
private Boolean can_send_welcome_messages;
private Boolean can_edit_tag;
private String tag;
private Boolean is_member;
Expand Down Expand Up @@ -142,6 +143,10 @@ public Boolean canManageTags() {
return can_manage_tags != null && can_manage_tags;
}

public Boolean canSendWelcomeMessages() {
return can_send_welcome_messages != null && can_send_welcome_messages;
}

public Boolean canEditTag() {
return can_edit_tag != null && can_edit_tag;
}
Expand Down Expand Up @@ -225,6 +230,7 @@ public boolean equals(Object o) {
Objects.equals(can_manage_topics, that.can_manage_topics) &&
Objects.equals(can_manage_direct_messages, that.can_manage_direct_messages) &&
Objects.equals(can_manage_tags, that.can_manage_tags) &&
Objects.equals(can_send_welcome_messages, that.can_send_welcome_messages) &&
Objects.equals(can_edit_tag, that.can_edit_tag) &&
Objects.equals(tag, that.tag) &&
Objects.equals(is_member, that.is_member) &&
Expand Down Expand Up @@ -265,6 +271,7 @@ public int hashCode() {
can_manage_topics,
can_manage_direct_messages,
can_manage_tags,
can_send_welcome_messages,
can_edit_tag,
tag,
is_member,
Expand Down Expand Up @@ -306,6 +313,7 @@ public String toString() {
", can_manage_topics=" + can_manage_topics +
", can_manage_direct_messages=" + can_manage_direct_messages +
", can_manage_tags=" + can_manage_tags +
", can_send_welcome_messages=" + can_send_welcome_messages +
", can_edit_tag=" + can_edit_tag +
", tag='" + tag + '\'' +
", is_member=" + is_member +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.pengrad.telegrambot.model

data class Community(
@get:JvmName("id") val id: Long,
@get:JvmName("name") val name: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.pengrad.telegrambot.model

data class CommunityChatAdded(
@get:JvmName("community") val community: Community,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.pengrad.telegrambot.model

data class CommunityChatJoined(
@get:JvmName("community") val community: Community,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.pengrad.telegrambot.model

class CommunityChatRemoved {

override fun equals(other: Any?): Boolean {
if (this === other) return true
return other != null && javaClass == other.javaClass
}

override fun hashCode(): Int = 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ public class Location implements Serializable {
private Integer heading;
private Integer proximity_alert_radius;

private Location() {
}
Comment on lines +20 to +21

public Location(Float latitude, Float longitude) {
this.latitude = latitude;
this.longitude = longitude;
}

public Float longitude() {
return longitude;
}
Expand Down
37 changes: 36 additions & 1 deletion library/src/main/java/com/pengrad/telegrambot/model/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
private Long message_thread_id;
private DirectMessagesTopic direct_messages_topic;
private User from;
private User receiver_user;
private Long ephemeral_message_id;
private Chat sender_chat;
private String sender_tag;
private Integer sender_boost_count;
Expand Down Expand Up @@ -146,6 +148,9 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
private User guest_bot_caller_user;
private Chat guest_bot_caller_chat;
private String guest_query_id;
private CommunityChatAdded community_chat_added;
private CommunityChatJoined community_chat_joined;
private CommunityChatRemoved community_chat_removed;

public Long messageThreadId() {
return message_thread_id;
Expand All @@ -159,6 +164,14 @@ public User from() {
return from;
}

public User receiverUser() {
return receiver_user;
}

public Long ephemeralMessageId() {
return ephemeral_message_id;
}

public Chat senderChat() {
return sender_chat;
}
Expand Down Expand Up @@ -584,6 +597,18 @@ public String replyToPollOptionId() {
return reply_to_poll_option_id;
}

public CommunityChatAdded communityChatAdded() {
return community_chat_added;
}

public CommunityChatJoined communityChatJoined() {
return community_chat_joined;
}

public CommunityChatRemoved communityChatRemoved() {
return community_chat_removed;
}

public User guestBotCallerUser() {
return guest_bot_caller_user;
}
Expand Down Expand Up @@ -626,6 +651,8 @@ public boolean equals(Object o) {
Objects.equals(message_thread_id, message.message_thread_id) &&
Objects.equals(direct_messages_topic, message.direct_messages_topic) &&
Objects.equals(from, message.from) &&
Objects.equals(receiver_user, message.receiver_user) &&
Objects.equals(ephemeral_message_id, message.ephemeral_message_id) &&
Objects.equals(sender_chat, message.sender_chat) &&
Objects.equals(sender_tag, message.sender_tag) &&
Objects.equals(sender_boost_count, message.sender_boost_count) &&
Expand Down Expand Up @@ -736,7 +763,10 @@ public boolean equals(Object o) {
Objects.equals(reply_to_poll_option_id, message.reply_to_poll_option_id) &&
Objects.equals(guest_bot_caller_user, message.guest_bot_caller_user) &&
Objects.equals(guest_bot_caller_chat, message.guest_bot_caller_chat) &&
Objects.equals(guest_query_id, message.guest_query_id);
Objects.equals(guest_query_id, message.guest_query_id) &&
Objects.equals(community_chat_added, message.community_chat_added) &&
Objects.equals(community_chat_joined, message.community_chat_joined) &&
Objects.equals(community_chat_removed, message.community_chat_removed);
}

@Override
Expand All @@ -751,6 +781,8 @@ public String toString() {
", message_thread_id=" + message_thread_id +
", direct_messages_topic=" + direct_messages_topic +
", from=" + from +
", receiver_user=" + receiver_user +
", ephemeral_message_id=" + ephemeral_message_id +
", sender_chat=" + sender_chat +
", sender_tag='" + sender_tag + '\'' +
", sender_boost_count=" + sender_boost_count +
Expand Down Expand Up @@ -862,6 +894,9 @@ public String toString() {
", guest_bot_caller_user=" + guest_bot_caller_user +
", guest_bot_caller_chat=" + guest_bot_caller_chat +
", guest_query_id='" + guest_query_id + '\'' +
", community_chat_added=" + community_chat_added +
", community_chat_joined=" + community_chat_joined +
", community_chat_removed=" + community_chat_removed +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.pengrad.telegrambot.model

data class MessageGenerationStopped(
@get:JvmName("chat") val chat: Chat,
@get:JvmName("messageThreadId") val messageThreadId: Long? = null,
@get:JvmName("draftId") val draftId: Int,
)
Loading
Loading