Skip to main content

rustigram_types/
video_chat.rs

1use serde::{Deserialize, Serialize};
2
3use crate::user::User;
4
5/// Service message: a video chat was scheduled.
6#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7#[non_exhaustive]
8pub struct VideoChatScheduled {
9    /// Point in time when the video chat is expected to start, as a Unix timestamp.
10    pub start_date: i64,
11}
12
13/// Service message: a video chat started.
14///
15/// Carries no data — its presence is the entire signal. Declared with braces
16/// rather than as a unit struct because Telegram sends `{}`, and a unit struct
17/// would only deserialize from `null`.
18#[derive(Debug, Clone, Default, Serialize, Deserialize)]
19#[non_exhaustive]
20pub struct VideoChatStarted {}
21
22/// Service message: a video chat ended.
23#[derive(Debug, Clone, Default, Serialize, Deserialize)]
24#[non_exhaustive]
25pub struct VideoChatEnded {
26    /// Video chat duration in seconds.
27    pub duration: u32,
28}
29
30/// Service message: new participants were invited to a video chat.
31#[derive(Debug, Clone, Default, Serialize, Deserialize)]
32#[non_exhaustive]
33pub struct VideoChatParticipantsInvited {
34    /// The users invited to the video chat.
35    pub users: Vec<User>,
36}