mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 06:25:10 +01:00
Move business_connection_id
from Message
to MessageCommon
This commit is contained in:
parent
cef553eeae
commit
08d7d8f6b4
3 changed files with 8 additions and 10 deletions
|
@ -59,12 +59,6 @@ pub struct Message {
|
|||
/// connected business account.
|
||||
pub sender_business_bot: Option<User>,
|
||||
|
||||
/// Unique identifier of the business connection from which the message was
|
||||
/// received. If non-empty, the message belongs to a chat of the
|
||||
/// corresponding business account that is independent from any potential
|
||||
/// bot chat which might share the same identifier.
|
||||
pub business_connection_id: Option<BusinessConnectionId>,
|
||||
|
||||
#[serde(flatten)]
|
||||
pub kind: MessageKind,
|
||||
}
|
||||
|
@ -170,6 +164,12 @@ pub struct MessageCommon {
|
|||
/// an away or a greeting business message, or as a scheduled message
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
pub is_from_offline: bool,
|
||||
|
||||
/// Unique identifier of the business connection from which the message was
|
||||
/// received. If non-empty, the message belongs to a chat of the
|
||||
/// corresponding business account that is independent from any potential
|
||||
/// bot chat which might share the same identifier.
|
||||
pub business_connection_id: Option<BusinessConnectionId>,
|
||||
}
|
||||
|
||||
#[serde_with::skip_serializing_none]
|
||||
|
@ -1917,7 +1917,6 @@ mod tests {
|
|||
chat_full_info: ChatFullInfo::default()
|
||||
},
|
||||
sender_business_bot: None,
|
||||
business_connection_id: None,
|
||||
kind: MessageKind::ChatShared(MessageChatShared {
|
||||
chat_shared: ChatShared {
|
||||
request_id: RequestId(348349),
|
||||
|
@ -2590,7 +2589,6 @@ mod tests {
|
|||
},
|
||||
via_bot: None,
|
||||
sender_business_bot: None,
|
||||
business_connection_id: None,
|
||||
kind: MessageKind::Giveaway(MessageGiveaway {
|
||||
giveaway: Giveaway {
|
||||
chats: vec![Chat {
|
||||
|
|
|
@ -609,7 +609,6 @@ mod test {
|
|||
chat_full_info: ChatFullInfo::default(),
|
||||
},
|
||||
sender_business_bot: None,
|
||||
business_connection_id: None,
|
||||
kind: MessageKind::Common(MessageCommon {
|
||||
reply_to_message: None,
|
||||
forward_origin: None,
|
||||
|
@ -634,6 +633,7 @@ mod test {
|
|||
is_automatic_forward: false,
|
||||
has_protected_content: false,
|
||||
is_from_offline: false,
|
||||
business_connection_id: None,
|
||||
}),
|
||||
}),
|
||||
};
|
||||
|
|
|
@ -190,7 +190,6 @@ mod tests {
|
|||
sender_chat: None,
|
||||
is_topic_message: false,
|
||||
sender_business_bot: None,
|
||||
business_connection_id: None,
|
||||
date,
|
||||
chat: Chat {
|
||||
id: ChatId(109_998_024),
|
||||
|
@ -239,6 +238,7 @@ mod tests {
|
|||
reply_to_story: None,
|
||||
sender_boost_count: None,
|
||||
is_from_offline: false,
|
||||
business_connection_id: None,
|
||||
}),
|
||||
}),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue