diff --git a/crates/teloxide-core/src/types.rs b/crates/teloxide-core/src/types.rs index 2ad352a8..54a24e76 100644 --- a/crates/teloxide-core/src/types.rs +++ b/crates/teloxide-core/src/types.rs @@ -9,6 +9,7 @@ pub use bot_command_scope::*; pub use bot_description::*; pub use bot_name::*; pub use bot_short_description::*; +pub use business_connection::*; pub use business_intro::*; pub use business_location::*; pub use business_opening_hours::*; @@ -167,6 +168,7 @@ mod bot_command_scope; mod bot_description; mod bot_name; mod bot_short_description; +mod business_connection; mod business_intro; mod business_location; mod business_opening_hours; diff --git a/crates/teloxide-core/src/types/business_connection.rs b/crates/teloxide-core/src/types/business_connection.rs new file mode 100644 index 00000000..466e3c3c --- /dev/null +++ b/crates/teloxide-core/src/types/business_connection.rs @@ -0,0 +1,28 @@ +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + +use crate::types::{User, UserId}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BusinessConnection { + /// Unique identifier of the business connection + pub id: String, + + /// Business account user that created the business connection + pub user: User, + + /// The user id of the private chat with the user who created the business + /// connection + pub user_chat_id: UserId, + + /// Date the connection was established in Unix time + #[serde(with = "crate::types::serde_date_from_unix_timestamp")] + pub date: DateTime, + + /// `true`, if the bot can act on behalf of the business account in chats + /// that were active in the last 24 hours + pub can_reply: bool, + + /// `true`, if the connection is alive + pub is_enabled: bool, +}