Add business conn. related fields to Message

Added `sender_business_bot` and `business_connection_id` fields
This commit is contained in:
Akshett Rai Jindal 2024-08-21 00:35:20 +05:30
parent 941d1eb82a
commit 1a5eca0a75
2 changed files with 17 additions and 0 deletions

View file

@ -54,6 +54,17 @@ pub struct Message {
/// Bot through which the message was sent. /// Bot through which the message was sent.
pub via_bot: Option<User>, pub via_bot: Option<User>,
/// The bot that actually sent the message on behalf of the business
/// account. Available only for outgoing messages sent on behalf of the
/// 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<String>,
#[serde(flatten)] #[serde(flatten)]
pub kind: MessageKind, pub kind: MessageKind,
} }
@ -1902,6 +1913,8 @@ mod tests {
has_hidden_members: false, has_hidden_members: false,
chat_full_info: ChatFullInfo::default() chat_full_info: ChatFullInfo::default()
}, },
sender_business_bot: None,
business_connection_id: None,
kind: MessageKind::ChatShared(MessageChatShared { kind: MessageKind::ChatShared(MessageChatShared {
chat_shared: ChatShared { chat_shared: ChatShared {
request_id: RequestId(348349), request_id: RequestId(348349),
@ -2573,6 +2586,8 @@ mod tests {
chat_full_info: ChatFullInfo::default() chat_full_info: ChatFullInfo::default()
}, },
via_bot: None, via_bot: None,
sender_business_bot: None,
business_connection_id: None,
kind: MessageKind::Giveaway(MessageGiveaway { kind: MessageKind::Giveaway(MessageGiveaway {
giveaway: Giveaway { giveaway: Giveaway {
chats: vec![Chat { chats: vec![Chat {

View file

@ -546,6 +546,8 @@ mod test {
has_aggressive_anti_spam_enabled: false, has_aggressive_anti_spam_enabled: false,
chat_full_info: ChatFullInfo::default(), chat_full_info: ChatFullInfo::default(),
}, },
sender_business_bot: None,
business_connection_id: None,
kind: MessageKind::Common(MessageCommon { kind: MessageKind::Common(MessageCommon {
reply_to_message: None, reply_to_message: None,
forward_origin: None, forward_origin: None,