Skip to content

Commit

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

0 comments on commit d057ff1

Please sign in to comment.