mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Add BusinessConnection
struct
This commit is contained in:
parent
6bec7a84ff
commit
e8afdc58fc
2 changed files with 30 additions and 0 deletions
|
@ -9,6 +9,7 @@ pub use bot_command_scope::*;
|
||||||
pub use bot_description::*;
|
pub use bot_description::*;
|
||||||
pub use bot_name::*;
|
pub use bot_name::*;
|
||||||
pub use bot_short_description::*;
|
pub use bot_short_description::*;
|
||||||
|
pub use business_connection::*;
|
||||||
pub use business_intro::*;
|
pub use business_intro::*;
|
||||||
pub use business_location::*;
|
pub use business_location::*;
|
||||||
pub use business_opening_hours::*;
|
pub use business_opening_hours::*;
|
||||||
|
@ -167,6 +168,7 @@ mod bot_command_scope;
|
||||||
mod bot_description;
|
mod bot_description;
|
||||||
mod bot_name;
|
mod bot_name;
|
||||||
mod bot_short_description;
|
mod bot_short_description;
|
||||||
|
mod business_connection;
|
||||||
mod business_intro;
|
mod business_intro;
|
||||||
mod business_location;
|
mod business_location;
|
||||||
mod business_opening_hours;
|
mod business_opening_hours;
|
||||||
|
|
28
crates/teloxide-core/src/types/business_connection.rs
Normal file
28
crates/teloxide-core/src/types/business_connection.rs
Normal file
|
@ -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<Utc>,
|
||||||
|
|
||||||
|
/// `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,
|
||||||
|
}
|
Loading…
Reference in a new issue