From 7639354ffc563810a9c522d88e780f85c8373a13 Mon Sep 17 00:00:00 2001 From: Andrew Anfanik Date: Sat, 6 Apr 2024 02:22:04 +0300 Subject: [PATCH] Add is_from_offline field to Message --- .../java/com/pengrad/telegrambot/model/Message.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/pengrad/telegrambot/model/Message.java b/library/src/main/java/com/pengrad/telegrambot/model/Message.java index 37b0263a..0ec8beba 100644 --- a/library/src/main/java/com/pengrad/telegrambot/model/Message.java +++ b/library/src/main/java/com/pengrad/telegrambot/model/Message.java @@ -34,6 +34,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable { private User via_bot; private Integer edit_date; private Boolean has_protected_content; + private Boolean is_from_offline; private Boolean has_media_spoiler; private String media_group_id; private String author_signature; @@ -227,11 +228,15 @@ public Integer editDate() { } public Boolean hasProtectedContent() { - return has_protected_content; + return has_protected_content != null && has_protected_content; + } + + public Boolean isFromOffline() { + return is_from_offline != null && is_from_offline; } public Boolean hasMediaSpoiler() { - return has_media_spoiler; + return has_media_spoiler != null && has_media_spoiler; } @@ -507,6 +512,7 @@ public boolean equals(Object o) { Objects.equals(via_bot, message.via_bot) && Objects.equals(edit_date, message.edit_date) && Objects.equals(has_protected_content, message.has_protected_content) && + Objects.equals(is_from_offline, message.is_from_offline) && Objects.equals(has_media_spoiler, message.has_media_spoiler) && Objects.equals(media_group_id, message.media_group_id) && Objects.equals(author_signature, message.author_signature) && @@ -593,6 +599,7 @@ public String toString() { ", via_bot=" + via_bot + ", edit_date=" + edit_date + ", has_protected_content=" + has_protected_content+ + ", is_from_offline=" + is_from_offline + ", has_media_spoiler=" + has_media_spoiler+ ", media_group_id='" + media_group_id + '\'' + ", author_signature='" + author_signature + '\'' +