Skip to content

Commit

Permalink
Add is_from_offline field to Message
Browse files Browse the repository at this point in the history
  • Loading branch information
anfanik committed Apr 5, 2024
1 parent 1345898 commit 7639354
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions library/src/main/java/com/pengrad/telegrambot/model/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}


Expand Down Expand Up @@ -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) &&
Expand Down Expand Up @@ -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 + '\'' +
Expand Down

0 comments on commit 7639354

Please sign in to comment.