1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use serde::{Deserialize, Serialize};
/// This object describes a message that was deleted or is otherwise inaccessible to the bot.
/// # Documentation
/// <https://core.telegram.org/bots/api#inaccessiblemessage>
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct InaccessibleMessage {
/// Chat the message belonged to
pub chat: Box<crate::types::Chat>,
/// Unique message identifier inside the chat
pub message_id: i64,
/// Always 0. The field can be used to differentiate regular and inaccessible messages.
pub date: i64,
}
impl InaccessibleMessage {
/// Creates a new `InaccessibleMessage`.
///
/// # Arguments
/// * `chat` - Chat the message belonged to
/// * `message_id` - Unique message identifier inside the chat
/// * `date` - Always 0. The field can be used to differentiate regular and inaccessible messages.
#[must_use]
pub fn new<T0: Into<crate::types::Chat>, T1: Into<i64>, T2: Into<i64>>(
chat: T0,
message_id: T1,
date: T2,
) -> Self {
Self {
chat: Box::new(chat.into()),
message_id: message_id.into(),
date: date.into(),
}
}
/// Chat the message belonged to
#[must_use]
pub fn chat<T: Into<crate::types::Chat>>(self, val: T) -> Self {
let mut this = self;
this.chat = Box::new(val.into());
this
}
/// Unique message identifier inside the chat
#[must_use]
pub fn message_id<T: Into<i64>>(self, val: T) -> Self {
let mut this = self;
this.message_id = val.into();
this
}
/// Always 0. The field can be used to differentiate regular and inaccessible messages.
#[must_use]
pub fn date<T: Into<i64>>(self, val: T) -> Self {
let mut this = self;
this.date = val.into();
this
}
}