Skip to main content

telers/types/
message_origin_hidden_user.rs

1use serde::{Deserialize, Serialize};
2/// The message was originally sent by an unknown user.
3/// # Documentation
4/// <https://core.telegram.org/bots/api#messageoriginhiddenuser>
5#[derive(Clone, Debug, Serialize, Deserialize)]
6pub struct MessageOriginHiddenUser {
7    /// Date the message was sent originally in Unix time
8    pub date: i64,
9    /// Name of the user that sent the message originally
10    pub sender_user_name: Box<str>,
11}
12impl MessageOriginHiddenUser {
13    /// Creates a new `MessageOriginHiddenUser`.
14    ///
15    /// # Arguments
16    /// * `date` - Date the message was sent originally in Unix time
17    /// * `sender_user_name` - Name of the user that sent the message originally
18    #[must_use]
19    pub fn new<T0: Into<i64>, T1: Into<Box<str>>>(date: T0, sender_user_name: T1) -> Self {
20        Self {
21            date: date.into(),
22            sender_user_name: sender_user_name.into(),
23        }
24    }
25
26    /// Date the message was sent originally in Unix time
27    #[must_use]
28    pub fn date<T: Into<i64>>(self, val: T) -> Self {
29        let mut this = self;
30        this.date = val.into();
31        this
32    }
33
34    /// Name of the user that sent the message originally
35    #[must_use]
36    pub fn sender_user_name<T: Into<Box<str>>>(self, val: T) -> Self {
37        let mut this = self;
38        this.sender_user_name = val.into();
39        this
40    }
41}