Enum grammers_client::types::chat::Chat
source · pub enum Chat {
User(User),
Group(Group),
Channel(Channel),
}
Expand description
A chat.
Chats represent places where you can share messages with others.
- Private conversations with other people are treated as the chat of the user itself.
- Conversations in a group, whether it’s private or public, are simply known as groups.
- Conversations where only administrators broadcast messages are known as channels.
Variants§
Implementations§
source§impl Chat
impl Chat
sourcepub fn id(&self) -> i64
pub fn id(&self) -> i64
Return the unique identifier for this chat.
Every account will see the same identifier for the same chat.
This identifier will never change. However, small group chats may be migrated to megagroups. If this happens, both the old small group chat and the new megagroup exist as separate chats with different identifiers, but they are linked with a property.
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Return the name of this chat.
For private conversations (users), this is their first name. For groups and channels, this is their title.
The name may be empty if the chat is inaccessible or if the account was deleted.
sourcepub fn pack(&self) -> PackedChat
pub fn pack(&self) -> PackedChat
Pack this chat into a smaller representation that can be loaded later.
sourcepub fn username(&self) -> Option<&str>
pub fn username(&self) -> Option<&str>
Return the public @username of this chat, if any.
The returned username does not contain the “@” prefix.
Outside of the application, people may link to this user with one of Telegram’s URLs, such as https://t.me/username.