From d057ff1212941b5094dfd3f60083557c6ed12cf7 Mon Sep 17 00:00:00 2001 From: Andrew Anfanik Date: Sat, 6 Apr 2024 02:24:56 +0300 Subject: [PATCH] Add can_connect_to_business field to User --- .../com/pengrad/telegrambot/model/User.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/pengrad/telegrambot/model/User.java b/library/src/main/java/com/pengrad/telegrambot/model/User.java index 6ca802a8..ae7bfc6c 100644 --- a/library/src/main/java/com/pengrad/telegrambot/model/User.java +++ b/library/src/main/java/com/pengrad/telegrambot/model/User.java @@ -21,6 +21,7 @@ public class User implements Serializable { private Boolean can_join_groups; private Boolean can_read_all_group_messages; private Boolean supports_inline_queries; + private Boolean can_connect_to_business; private User() { } @@ -73,12 +74,27 @@ public Boolean supportsInlineQueries() { return supports_inline_queries != null && supports_inline_queries; } + public Boolean canConnectToBusiness() { + return can_connect_to_business != null && can_connect_to_business; + } + @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (!(o instanceof User)) return false; User user = (User) o; - return Objects.equals(id, user.id) && Objects.equals(is_bot, user.is_bot) && Objects.equals(first_name, user.first_name) && Objects.equals(last_name, user.last_name) && Objects.equals(username, user.username) && Objects.equals(language_code, user.language_code) && Objects.equals(is_premium, user.is_premium) && Objects.equals(added_to_attachment_menu, user.added_to_attachment_menu) && Objects.equals(can_join_groups, user.can_join_groups) && Objects.equals(can_read_all_group_messages, user.can_read_all_group_messages) && Objects.equals(supports_inline_queries, user.supports_inline_queries); + return Objects.equals(id, user.id) + && Objects.equals(is_bot, user.is_bot) + && Objects.equals(first_name, user.first_name) + && Objects.equals(last_name, user.last_name) + && Objects.equals(username, user.username) + && Objects.equals(language_code, user.language_code) + && Objects.equals(is_premium, user.is_premium) + && Objects.equals(added_to_attachment_menu, user.added_to_attachment_menu) + && Objects.equals(can_join_groups, user.can_join_groups) + && Objects.equals(can_read_all_group_messages, user.can_read_all_group_messages) + && Objects.equals(supports_inline_queries, user.supports_inline_queries) + && Objects.equals(can_connect_to_business, user.can_connect_to_business); } @Override @@ -100,6 +116,7 @@ public String toString() { ", can_join_groups=" + can_join_groups + ", can_read_all_group_messages=" + can_read_all_group_messages + ", supports_inline_queries=" + supports_inline_queries + + ", can_connect_to_business=" + can_connect_to_business + '}'; } } \ No newline at end of file