Skip to content

BOT API v7.4 #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7a62cf5
7.2 to 7.4 draft
mircoianese May 28, 2024
91fb77a
Added the field via_join_request to the class ChatMemberUpdated
mircoianese May 28, 2024
a7cb371
Added support for live locations that can be edited indefinitely, all…
mircoianese May 28, 2024
cc31529
Added the parameter live_period to the method editMessageLiveLocation
mircoianese May 28, 2024
0b8a9e3
Added the field question_entities to the class Poll
mircoianese May 28, 2024
10aa4d1
Added the field text_entities to the class PollOption
mircoianese May 28, 2024
7095153
Added the parameters question_parse_mode and question_entities to the…
mircoianese May 28, 2024
eac068d
Added the class InputPollOption and changed the type of the parameter…
mircoianese May 28, 2024
5801684
Added the classes ChatBackground, BackgroundType, BackgroundFill and …
mircoianese May 28, 2024
ccca735
Split out the class ChatFullInfo from the class Chat and changed the …
mircoianese May 28, 2024
e958d4e
Added the field max_reaction_count to the class ChatFullInfo
mircoianese May 28, 2024
7686687
Fix ChatTests
mircoianese May 28, 2024
ce52f47
more tests fixes
mircoianese May 28, 2024
63f5038
remove constructor for LivePeriod class
mircoianese May 29, 2024
6c0448a
he parameter provider_token of the methods sendInvoice and createInvo…
mircoianese May 29, 2024
eb11f2d
The field provider_token in the class InputInvoiceMessageContent must…
mircoianese May 29, 2024
a02d7dc
Added the method refundStarPayment
mircoianese May 29, 2024
cd9b20b
Added the field effect_id to the class Message
mircoianese May 29, 2024
8c599a8
Added the parameter message_effect_id to AbstractSendRequest
mircoianese May 29, 2024
b23a0d8
Added the field show_caption_above_media to the classes: Message, Inp…
mircoianese May 29, 2024
15a0a48
Added the parameter shAdded the parameter show_caption_above_media to…
mircoianese May 29, 2024
0c4bcc2
Added support for “expandable_blockquote”
mircoianese May 29, 2024
0f78926
Fix: added BackgroundFillAdapter and BackgroundTypeAdapter for deseri…
mircoianese May 29, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ private.key
.project
library/.classpath
sample/.classpath
.vscode/settings.json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:7.2.1'
implementation 'com.github.pengrad:java-telegram-bot-api:7.4.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.pengrad</groupId>
<artifactId>java-telegram-bot-api</artifactId>
<version>7.2.1</version>
<version>7.4.0</version>
</dependency>
```
[JAR with all dependencies on release page](https://github.com/pengrad/java-telegram-bot-api/releases)
Expand Down
4 changes: 2 additions & 2 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Java библиотека, созданная для работы с [Telegram B

Gradle:
```groovy
implementation 'com.github.pengrad:java-telegram-bot-api:7.2.1'
implementation 'com.github.pengrad:java-telegram-bot-api:7.4.0'
```
Maven:
```xml
<dependency>
<groupId>com.github.pengrad</groupId>
<artifactId>java-telegram-bot-api</artifactId>
<version>7.2.1</version>
<version>7.4.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=7.2.1
VERSION_NAME=7.4.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
@@ -0,0 +1,9 @@
package com.pengrad.telegrambot.constants;

public class LivePeriod {

public final static Integer INFINITE_LIVE_PERIOD = Integer.MAX_VALUE;

private LivePeriod() { }

}
271 changes: 2 additions & 269 deletions library/src/main/java/com/pengrad/telegrambot/model/Chat.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package com.pengrad.telegrambot.model;

import com.google.gson.annotations.SerializedName;
import com.pengrad.telegrambot.model.business.BusinessIntro;
import com.pengrad.telegrambot.model.business.BusinessLocation;
import com.pengrad.telegrambot.model.business.BusinessOpeningHours;
import com.pengrad.telegrambot.model.reaction.ReactionType;


import java.io.Serializable;
import java.util.Arrays;
import java.util.Objects;

/**
Expand Down Expand Up @@ -36,41 +30,6 @@ public enum Type {
private String last_name;

private Boolean is_forum;
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 ReactionType[] available_reactions;
private Integer accent_color_id;
private String background_custom_emoji_id;
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 String bio;
private Boolean has_private_forwards;
private Boolean has_restricted_voice_and_video_messages;
private Boolean has_hidden_members;
private Boolean has_aggressive_anti_spam_enabled;
private Boolean join_to_send_messages;
private Boolean join_by_request;
private String description;
private String invite_link;
private Message pinned_message;
private ChatPermissions permissions;
private Integer slow_mode_delay;
private Integer unrestrict_boost_count;
private Integer message_auto_delete_time;
private Boolean has_protected_content;
private Boolean has_visible_history;
private String sticker_set_name;
private Boolean can_set_sticker_set;
private String custom_emoji_sticker_set_name;
private Long linked_chat_id;
private ChatLocation location;

public Long id() {
return id;
Expand Down Expand Up @@ -100,162 +59,6 @@ public String title() {
return title;
}

public ChatPhoto photo() {
return photo;
}

/**
* @deprecated Use activeUsernames() instead
*/
@Deprecated
public String[] getActiveUsernames() {
return active_usernames;
}

public String[] activeUsernames() {
return active_usernames;
}

public Birthdate birthdate() {
return birthdate;
}

public BusinessIntro businessIntro() {
return business_intro;
}

public BusinessLocation businessLocation() {
return business_location;
}

public BusinessOpeningHours businessOpeningHours() {
return business_opening_hours;
}

public Chat personalChat() {
return personal_chat;
}

public ReactionType[] availableReactions() {
return available_reactions;
}

public Integer accentColorId() {
return accent_color_id;
}

public String backgroundCustomEmojiId() {
return background_custom_emoji_id;
}

public Integer profileAccentColorId() {
return profile_accent_color_id;
}

public String profileBackgroundCustomEmojiId() {
return profile_background_custom_emoji_id;
}

/**
* @deprecated Use emojiStatusCustomEmojiId() instead
*/
@Deprecated
public String getEmojiStatusCustomEmojiId() {
return emoji_status_custom_emoji_id;
}

public String emojiStatusCustomEmojiId() {
return emoji_status_custom_emoji_id;
}

public Integer emojiStatusExpirationDate() {
return emoji_status_expiration_date;
}

public String bio() {
return bio;
}

public Boolean hasPrivateForwards() {
return has_private_forwards != null && has_private_forwards;
}

public Boolean hasRestrictedVoiceAndVideoMessages() {
return has_restricted_voice_and_video_messages != null && has_restricted_voice_and_video_messages;
}

public Boolean hasHiddenMembers() {
return has_hidden_members != null && has_hidden_members;
}

public Boolean hasAggressiveAntiSpamEnabled() {
return has_aggressive_anti_spam_enabled != null && has_aggressive_anti_spam_enabled;
}

public Boolean joinToSendMessages() {
return join_to_send_messages != null && join_to_send_messages;
}

public Boolean joinByRequest() {
return join_by_request != null && join_by_request;
}

public String description() {
return description;
}

public String inviteLink() {
return invite_link;
}

public Message pinnedMessage() {
return pinned_message;
}

public ChatPermissions permissions() {
return permissions;
}

public Integer slowModeDelay() {
return slow_mode_delay;
}

public Integer unrestrictBoostCount() {
return unrestrict_boost_count;
}

public Integer messageAutoDeleteTime() {
return message_auto_delete_time;
}

public Boolean hasProtectedContent() {
return has_protected_content != null && has_protected_content;
}

public Boolean hasVisibleHistory() {
return has_visible_history != null && has_visible_history;
}

public String stickerSetName() {
return sticker_set_name;
}

public Boolean canSetStickerSet() {
return can_set_sticker_set != null && can_set_sticker_set;
}

public String customEmojiStickerSetName() {
return custom_emoji_sticker_set_name;
}

public Long linkedChatId() {
return linked_chat_id;
}

public ChatLocation location() {
return location;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -267,42 +70,7 @@ public boolean equals(Object o) {
Objects.equals(last_name, chat.last_name) &&
Objects.equals(is_forum, chat.is_forum) &&
Objects.equals(username, chat.username) &&
Objects.equals(title, chat.title) &&
Objects.equals(photo, chat.photo) &&
Arrays.equals(active_usernames, chat.active_usernames) &&
Objects.equals(birthdate, chat.birthdate) &&
Objects.equals(business_intro, chat.business_intro) &&
Objects.equals(business_location, chat.business_location) &&
Objects.equals(business_opening_hours, chat.business_opening_hours) &&
Objects.equals(personal_chat, chat.personal_chat) &&
Arrays.equals(available_reactions, chat.available_reactions) &&
Objects.equals(accent_color_id, chat.accent_color_id) &&
Objects.equals(background_custom_emoji_id, chat.background_custom_emoji_id) &&
Objects.equals(profile_accent_color_id, chat.profile_accent_color_id) &&
Objects.equals(profile_background_custom_emoji_id, chat.profile_background_custom_emoji_id) &&
Objects.equals(emoji_status_custom_emoji_id, chat.emoji_status_custom_emoji_id) &&
Objects.equals(emoji_status_expiration_date, chat.emoji_status_expiration_date) &&
Objects.equals(bio, chat.bio) &&
Objects.equals(has_private_forwards, chat.has_private_forwards) &&
Objects.equals(has_restricted_voice_and_video_messages, chat.has_restricted_voice_and_video_messages) &&
Objects.equals(has_hidden_members, chat.has_hidden_members) &&
Objects.equals(has_aggressive_anti_spam_enabled, chat.has_aggressive_anti_spam_enabled) &&
Objects.equals(join_to_send_messages, chat.join_to_send_messages) &&
Objects.equals(join_by_request, chat.join_by_request) &&
Objects.equals(description, chat.description) &&
Objects.equals(invite_link, chat.invite_link) &&
Objects.equals(pinned_message, chat.pinned_message) &&
Objects.equals(permissions, chat.permissions) &&
Objects.equals(slow_mode_delay, chat.slow_mode_delay) &&
Objects.equals(unrestrict_boost_count, chat.unrestrict_boost_count) &&
Objects.equals(message_auto_delete_time, chat.message_auto_delete_time) &&
Objects.equals(has_protected_content, chat.has_protected_content) &&
Objects.equals(has_visible_history, chat.has_visible_history) &&
Objects.equals(sticker_set_name, chat.sticker_set_name) &&
Objects.equals(can_set_sticker_set, chat.can_set_sticker_set) &&
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(title, chat.title);
}

@Override
Expand All @@ -319,42 +87,7 @@ public String toString() {
", last_name='" + last_name + '\'' +
", is_forum=" + is_forum +
", username='" + username + '\'' +
", title='" + title + '\'' +
", photo=" + photo +
", active_usernames=" + Arrays.toString(active_usernames) +
", birthdate=" + birthdate +
", business_intro=" + business_intro +
", business_location=" + business_location +
", business_opening_hours=" + business_opening_hours +
", personal_chat=" + personal_chat +
", available_reactions=" + Arrays.toString(available_reactions) +
", accent_color_id=" + accent_color_id +
", background_custom_emoji_id='" + background_custom_emoji_id + '\'' +
", profile_accent_color_id=" + profile_accent_color_id +
", profile_background_custom_emoji_id='" + profile_background_custom_emoji_id + '\'' +
", emoji_status_custom_emoji_id='" + emoji_status_custom_emoji_id + '\'' +
", emoji_status_expiration_date='" + emoji_status_expiration_date + '\'' +
", bio='" + bio + '\'' +
", has_private_forwards=" + has_private_forwards +
", has_restricted_voice_and_video_messages=" + has_restricted_voice_and_video_messages +
", has_hidden_members=" + has_hidden_members +
", has_aggressive_anti_spam_enabled=" + has_aggressive_anti_spam_enabled +
", join_to_send_messages=" + join_to_send_messages +
", join_by_request=" + join_by_request +
", description='" + description + '\'' +
", invite_link='" + invite_link + '\'' +
", pinned_message=" + pinned_message +
", permissions=" + permissions +
", slow_mode_delay=" + slow_mode_delay +
", unrestrict_boost_count=" + unrestrict_boost_count +
", message_auto_delete_time=" + message_auto_delete_time +
", has_protected_content=" + has_protected_content +
", has_visible_history=" + has_visible_history +
", sticker_set_name='" + sticker_set_name + '\'' +
", can_set_sticker_set=" + can_set_sticker_set +
", custom_emoji_sticker_set_name=" + custom_emoji_sticker_set_name +
", linked_chat_id=" + linked_chat_id +
", location=" + location +
", title='" + title + '\'' +
'}';
}
}
Loading