Skip to content

Commit

Permalink
Fix Message.business_connection_id #400
Browse files Browse the repository at this point in the history
  • Loading branch information
pengrad committed Nov 2, 2024
1 parent 790c8d8 commit a54250e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
18 changes: 10 additions & 8 deletions library/src/main/java/com/pengrad/telegrambot/model/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
private Chat sender_chat;
private Integer sender_boost_count;
private User sender_business_bot;
private BusinessConnection business_connection;
private String business_connection_id;
private MessageOrigin forward_origin;
private Boolean is_topic_message;
private Boolean is_automatic_forward;
Expand Down Expand Up @@ -129,8 +129,8 @@ public User senderBusinessBot() {
return sender_business_bot;
}

public BusinessConnection businessConnection() {
return business_connection;
public String businessConnectionId() {
return business_connection_id;
}

public MessageOrigin forwardOrigin() {
Expand Down Expand Up @@ -223,9 +223,11 @@ public Boolean isAutomaticForward() {
public Message replyToMessage() {
return reply_to_message;
}

public ExternalReplyInfo externalReply() {
return external_reply;
}

public TextQuote quote() {
return quote;
}
Expand Down Expand Up @@ -546,13 +548,13 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
Message message = (Message) o;
return Objects.equals(message_id, message.message_id) &&
Objects.equals(message_thread_id , message.message_thread_id ) &&
Objects.equals(message_thread_id, message.message_thread_id) &&
Objects.equals(from, message.from) &&
Objects.equals(sender_chat, message.sender_chat) &&
Objects.equals(sender_boost_count, message.sender_boost_count) &&
Objects.equals(date, message.date) &&
Objects.equals(sender_business_bot, message.sender_business_bot) &&
Objects.equals(business_connection, message.business_connection) &&
Objects.equals(business_connection_id, message.business_connection_id) &&
Objects.equals(chat, message.chat) &&
Objects.equals(forward_origin, message.forward_origin) &&
Objects.equals(is_topic_message, message.is_topic_message) &&
Expand Down Expand Up @@ -648,7 +650,7 @@ public String toString() {
", sender_boost_count=" + sender_boost_count +
", date=" + date +
", sender_business_bot=" + sender_business_bot +
", business_connection=" + business_connection +
", business_connection_id=" + business_connection_id +
", chat=" + chat +
", forward_origin=" + forward_origin +
", is_topic_message=" + is_topic_message +
Expand All @@ -659,9 +661,9 @@ public String toString() {
", reply_to_story=" + reply_to_story +
", via_bot=" + via_bot +
", edit_date=" + edit_date +
", has_protected_content=" + has_protected_content+
", has_protected_content=" + has_protected_content +
", is_from_offline=" + is_from_offline +
", has_media_spoiler=" + has_media_spoiler+
", has_media_spoiler=" + has_media_spoiler +
", media_group_id='" + media_group_id + '\'' +
", author_signature='" + author_signature + '\'' +
", text='" + text + '\'' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public static void checkMessage(Message message) {
public static void checkTextMessage(Message message) {
checkMessage(message);
assertNotNull(message.text());
assertNull(message.messageThreadId());
assertNull(message.senderBoostCount());
assertNull(message.senderBusinessBot());
assertNull(message.businessConnectionId());
assertNull(message.forwardOrigin());
assertNull(message.newChatMembers());
assertNull(message.leftChatMember());
assertNull(message.newChatTitle());
Expand All @@ -32,19 +37,36 @@ public static void checkTextMessage(Message message) {
assertNull(message.pinnedMessage());
assertNull(message.successfulPayment());
assertNull(message.connectedWebsite());
assertNull(message.messageThreadId());
assertFalse(message.isTopicMessage());
assertNull(message.isAutomaticForward());
assertNull(message.replyToMessage());
assertNull(message.externalReply());
assertNull(message.quote());
assertNull(message.replyToStory());
assertFalse(message.isFromOffline());
assertFalse(message.hasMediaSpoiler());
assertNull(message.showCaptionAboveMedia());
assertNull(message.linkPreviewOptions());
assertNull(message.effectId());
assertNull(message.messageAutoDeleteTimerChanged());
assertNull(message.refundedPayment());
assertNull(message.story());
assertNull(message.usersShared());
assertNull(message.userShared());
assertNull(message.chatShared());
assertNull(message.proximityAlertTriggered());
assertNull(message.boostAdded());
assertNull(message.chatBackgroundSet());
assertNull(message.forumTopicCreated());
assertNull(message.forumTopicEdited());
assertNull(message.forumTopicClosed());
assertNull(message.forumTopicReopened());
assertNull(message.generalForumTopicHidden());
assertNull(message.generalForumTopicUnhidden());
assertNull(message.giveawayCreated());
assertNull(message.giveaway());
assertNull(message.giveawayWinners());
assertNull(message.giveawayCompleted());
assertNull(message.writeAccessAllowed());
assertNull(message.videoChatStarted());
assertNull(message.videoChatEnded());
Expand Down

0 comments on commit a54250e

Please sign in to comment.