Skip to main content

rustigram_types/
community.rs

1use serde::{Deserialize, Serialize};
2
3/// A community (a group of chats).
4///
5/// Several supergroups, channels, and bots linked together around a shared
6/// topic or audience.
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct Community {
9    /// Unique identifier for this community. May have more than 32
10    /// significant bits — safe to store as a signed 64-bit integer or
11    /// double-precision float.
12    pub id: i64,
13    /// Name of the community.
14    pub name: String,
15}
16
17/// A service message about a chat being added to a community.
18#[derive(Debug, Clone, Serialize, Deserialize)]
19pub struct CommunityChatAdded {
20    /// The new community to which the chat belongs.
21    pub community: Community,
22}
23
24/// A service message about a chat being removed from a community.
25///
26/// Currently holds no information.
27#[derive(Debug, Clone, Serialize, Deserialize, Default)]
28pub struct CommunityChatRemoved {}