Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8dc36ca
Fix typo
mircoianese Aug 19, 2025
b4d0732
Added the class ChecklistTask representing a task in a checklist.
mircoianese Aug 19, 2025
3ff0c2d
Added the class Checklist representing a checklist.
mircoianese Aug 19, 2025
3a5970c
Added the class InputChecklistTask representing a task to add to a ch…
mircoianese Aug 19, 2025
1483cb9
Added the class InputChecklist representing a checklist to create.
mircoianese Aug 19, 2025
4a0b0bb
Added the field checklist to the classes Message and ExternalReplyInf…
mircoianese Aug 19, 2025
faa30a8
Added the class ChecklistTasksDone and the field checklist_tasks_done…
mircoianese Aug 19, 2025
573d084
Added the class ChecklistTasksAdded and the field checklist_tasks_add…
mircoianese Aug 19, 2025
908bb89
Added the method sendChecklist, allowing bots to send a checklist on …
mircoianese Aug 19, 2025
a0283e8
Added the method editMessageChecklist, allowing bots to edit a checkl…
mircoianese Aug 19, 2025
70462f8
Added the field next_transfer_date to the classes OwnedGiftUnique and…
mircoianese Aug 19, 2025
8c1c8f9
Added the field last_resale_star_count to the class UniqueGiftInfo.
mircoianese Aug 19, 2025
5ed4e27
Added the method getMyStarBalance, allowing bots to get their current…
mircoianese Aug 19, 2025
ae41191
Added the class DirectMessagePriceChanged and the field direct_messag…
mircoianese Aug 19, 2025
4cad17e
Fix JvmName on Checklist.kt
mircoianese Aug 19, 2025
510ea92
Added the field checklist_task_id to the class ReplyParameters, allow…
mircoianese Aug 20, 2025
410324c
Added the field reply_to_checklist_task_id to the class Message
mircoianese Aug 20, 2025
7bd458c
Added the field publisher_chat to the classes Gift and UniqueGift whi…
mircoianese Aug 20, 2025
1860fee
Added the field is_direct_messages to the classes Chat and ChatFullIn…
mircoianese Aug 20, 2025
e52b0e7
Added the field parent_chat to the class ChatFullInfo which indicates…
mircoianese Aug 20, 2025
b2e6611
Added the class DirectMessagesTopic and the field direct_messages_top…
mircoianese Aug 20, 2025
18e4463
Added the parameter direct_messages_topic_id to the methods sendMessa…
mircoianese Aug 20, 2025
9b6a335
Added the class SuggestedPostPrice, describing the price of a suggest…
mircoianese Aug 20, 2025
d7f06cd
Added the class SuggestedPostParameters and the parameter suggested_p…
mircoianese Aug 20, 2025
5e79924
Added the method approveSuggestedPost
mircoianese Aug 20, 2025
8df8ff0
Added the method declineSuggestedPost
mircoianese Aug 20, 2025
8f638e2
Added the field can_manage_direct_messages to the classes ChatMemberA…
mircoianese Aug 20, 2025
47d033b
Added the parameter can_manage_direct_messages to the method promoteC…
mircoianese Aug 20, 2025
cbb13d8
Added the field is_paid_post to the class Message
mircoianese Aug 20, 2025
b6da959
Added the class SuggestedPostInfo and the field suggested_post_info t…
mircoianese Aug 20, 2025
ad62601
Added the classes SuggestedPostApproved, SuggestedPostApprovalFailed,…
mircoianese Aug 20, 2025
ceb57c4
Bump to 9.2.0
mircoianese Aug 20, 2025
d5e7800
Copilot minor changes
mircoianese Aug 20, 2025
3781d59
Fix bugs
mircoianese Aug 20, 2025
8eb50e4
Fix typo
mircoianese Aug 20, 2025
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.0 methods
- Full support of all Bot API 9.2 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.0.0'
implementation 'com.github.pengrad:java-telegram-bot-api:9.2.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.pengrad</groupId>
<artifactId>java-telegram-bot-api</artifactId>
<version>9.0.0</version>
<version>9.2.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.0
- Полная поддержка всех методов BOT API 9.2
- Поддержка 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.0.0'
implementation 'com.github.pengrad:java-telegram-bot-api:9.2.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.pengrad</groupId>
<artifactId>java-telegram-bot-api</artifactId>
<version>9.0.0</version>
<version>9.2.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.0.0
VERSION_NAME=9.2.0

POM_DESCRIPTION=Java API for Telegram Bot API
POM_URL=https://github.com/pengrad/java-telegram-bot-api/
Expand Down
8 changes: 8 additions & 0 deletions library/src/main/java/com/pengrad/telegrambot/model/Chat.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public enum Type {

private Boolean is_forum;

private Boolean is_direct_messages;

public Long id() {
return id;
}
Expand All @@ -55,6 +57,10 @@ public Boolean isForum() {
return is_forum != null && is_forum;
}

public Boolean isDirectMessages() {
return is_direct_messages != null && is_direct_messages;
}

public String title() {
return title;
}
Expand All @@ -69,6 +75,7 @@ public boolean equals(Object o) {
Objects.equals(first_name, chat.first_name) &&
Objects.equals(last_name, chat.last_name) &&
Objects.equals(is_forum, chat.is_forum) &&
Objects.equals(is_direct_messages, chat.is_direct_messages) &&
Objects.equals(username, chat.username) &&
Objects.equals(title, chat.title);
}
Expand All @@ -86,6 +93,7 @@ public String toString() {
", first_name='" + first_name + '\'' +
", last_name='" + last_name + '\'' +
", is_forum=" + is_forum +
", is_direct_messages=" + is_direct_messages +
", username='" + username + '\'' +
", title='" + title + '\'' +
'}';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class ChatAdministratorRights implements Serializable {
private Boolean can_edit_stories;
private Boolean can_delete_stories;
private Boolean can_manage_topics;
private Boolean can_manage_direct_messages;

public Boolean isAnonymous() {
return is_anonymous != null && is_anonymous;
Expand Down Expand Up @@ -87,6 +88,10 @@ public Boolean canManageTopics() {
return can_manage_topics != null && can_manage_topics;
}

public Boolean canManageDirectMessages() {
return can_manage_direct_messages != null && can_manage_direct_messages;
}

public ChatAdministratorRights canManageChat(boolean canManageChat) {
this.can_manage_chat = canManageChat;
return this;
Expand Down Expand Up @@ -157,6 +162,11 @@ public ChatAdministratorRights canManageTopics(boolean canManageTopics) {
return this;
}

public ChatAdministratorRights canManageDirectMessages(boolean can_manage_direct_messages) {
this.can_manage_direct_messages = can_manage_direct_messages;
return this;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -177,7 +187,8 @@ public boolean equals(Object o) {
Objects.equals(can_post_stories, that.can_post_stories) &&
Objects.equals(can_edit_stories, that.can_edit_stories) &&
Objects.equals(can_delete_stories, that.can_delete_stories) &&
Objects.equals(can_manage_topics, that.can_manage_topics);
Objects.equals(can_manage_topics, that.can_manage_topics) &&
Objects.equals(can_manage_direct_messages, that.can_manage_direct_messages);
}

@Override
Expand All @@ -196,7 +207,8 @@ public int hashCode() {
can_post_stories,
can_edit_stories,
can_delete_stories,
can_manage_topics);
can_manage_topics,
can_manage_direct_messages);
}

@Override
Expand All @@ -217,6 +229,7 @@ public String toString() {
", can_edit_stories=" + can_edit_stories +
", can_delete_stories=" + can_delete_stories +
", can_manage_topics=" + can_manage_topics +
", can_manage_direct_messages=" + can_manage_direct_messages +
'}';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ public enum Type {
private String last_name;

private Boolean is_forum;
private Boolean is_direct_messages;
private ChatPhoto photo;
private String[] active_usernames;
private Birthdate birthdate;
private BusinessIntro business_intro;
private BusinessLocation business_location;
private BusinessOpeningHours business_opening_hours;
private Chat personal_chat;
private Chat parent_chat;
private ReactionType[] available_reactions;
private Integer accent_color_id;
private Integer max_reaction_count;
Expand Down Expand Up @@ -98,6 +100,10 @@ public Boolean isForum() {
return is_forum != null && is_forum;
}

public Boolean isDirectMessages() {
return is_direct_messages != null && is_direct_messages;
}

public String title() {
return title;
}
Expand Down Expand Up @@ -130,6 +136,10 @@ public Chat personalChat() {
return personal_chat;
}

public Chat parentChat() {
return parent_chat;
}

public ReactionType[] availableReactions() {
return available_reactions;
}
Expand Down Expand Up @@ -272,6 +282,7 @@ public boolean equals(Object o) {
Objects.equals(first_name, chat.first_name) &&
Objects.equals(last_name, chat.last_name) &&
Objects.equals(is_forum, chat.is_forum) &&
Objects.equals(is_direct_messages, chat.is_direct_messages) &&
Objects.equals(username, chat.username) &&
Objects.equals(title, chat.title) &&
Objects.equals(photo, chat.photo) &&
Expand All @@ -281,6 +292,7 @@ public boolean equals(Object o) {
Objects.equals(business_location, chat.business_location) &&
Objects.equals(business_opening_hours, chat.business_opening_hours) &&
Objects.equals(personal_chat, chat.personal_chat) &&
Objects.equals(parent_chat, chat.parent_chat) &&
Arrays.equals(available_reactions, chat.available_reactions) &&
Objects.equals(accent_color_id, chat.accent_color_id) &&
Objects.equals(max_reaction_count, chat.max_reaction_count) &&
Expand Down Expand Up @@ -327,6 +339,7 @@ public String toString() {
", first_name='" + first_name + '\'' +
", last_name='" + last_name + '\'' +
", is_forum=" + is_forum +
", is_direct_messages=" + is_direct_messages +
", username='" + username + '\'' +
", title='" + title + '\'' +
", photo=" + photo +
Expand All @@ -336,6 +349,7 @@ public String toString() {
", business_location=" + business_location +
", business_opening_hours=" + business_opening_hours +
", personal_chat=" + personal_chat +
", parent_chat=" + parent_chat +
", available_reactions=" + Arrays.toString(available_reactions) +
", accent_color_id=" + accent_color_id +
", max_reaction_count=" + max_reaction_count +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public enum Status {
private Boolean can_edit_stories;
private Boolean can_delete_stories;
private Boolean can_manage_topics;
private Boolean can_manage_direct_messages;
private Boolean is_member;
private Boolean can_send_messages;

Expand Down Expand Up @@ -129,6 +130,10 @@ public Boolean canManageTopics() {
return can_manage_topics != null && can_manage_topics;
}

public Boolean canManageDirectMessages() {
return can_manage_direct_messages != null && can_manage_direct_messages;
}

public Boolean isMember() {
return is_member != null && is_member;
}
Expand Down Expand Up @@ -198,6 +203,7 @@ public boolean equals(Object o) {
Objects.equals(can_edit_stories, that.can_edit_stories) &&
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(is_member, that.is_member) &&
Objects.equals(can_send_messages, that.can_send_messages) &&
Objects.equals(can_send_audios, that.can_send_audios) &&
Expand Down Expand Up @@ -233,6 +239,7 @@ public int hashCode() {
can_edit_stories,
can_delete_stories,
can_manage_topics,
can_manage_direct_messages,
is_member,
can_send_messages,
can_send_audios,
Expand Down Expand Up @@ -269,6 +276,7 @@ public String toString() {
", can_edit_stories=" + can_edit_stories +
", can_delete_stories=" + can_delete_stories +
", can_manage_topics=" + can_manage_topics +
", can_manage_direct_messages=" + can_manage_direct_messages +
", is_member=" + is_member +
", can_send_messages=" + can_send_messages +
", can_send_audios=" + can_send_audios +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.pengrad.telegrambot.model

@Suppress("unused")
data class DirectMessagesTopic (
@get:JvmName("topicId") val topicId: Int,
@get:JvmName("user") val user: User?
) {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pengrad.telegrambot.model;

import com.pengrad.telegrambot.model.checklist.Checklist;
import com.pengrad.telegrambot.model.giveaway.Giveaway;
import com.pengrad.telegrambot.model.giveaway.GiveawayWinners;
import com.pengrad.telegrambot.model.message.origin.MessageOrigin;
Expand Down Expand Up @@ -28,6 +29,7 @@ public class ExternalReplyInfo implements Serializable {
private VideoNote video_note;
private Voice voice;
private Boolean has_media_spoiler;
private Checklist checklist;
private Contact contact;
private Dice dice;
private Game game;
Expand Down Expand Up @@ -97,6 +99,10 @@ public Boolean hasMediaSpoiler() {
return has_media_spoiler;
}

public Checklist checklist() {
return checklist;
}

public Contact contact() {
return contact;
}
Expand Down Expand Up @@ -138,12 +144,12 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ExternalReplyInfo that = (ExternalReplyInfo) o;
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);
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);
}

@Override
public int hashCode() {
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);
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);
result = 31 * result + Arrays.hashCode(photo);
return result;
}
Expand All @@ -166,6 +172,7 @@ public String toString() {
", video_note=" + video_note +
", voice=" + voice +
", has_media_spoiler=" + has_media_spoiler +
", checklist=" + checklist +
", contact=" + contact +
", dice=" + dice +
", game=" + game +
Expand Down
Loading
Loading