Struct tgbot::types::ChannelChat

source ·
pub struct ChannelChat {
Show 18 fields pub id: ChatPeerId, pub title: String, pub accent_color: Option<AccentColor>, pub active_usernames: Option<Vec<String>>, pub available_reactions: Option<Vec<ReactionType>>, pub background_custom_emoji_id: Option<String>, pub description: Option<String>, pub emoji_status_custom_emoji_id: Option<String>, pub emoji_status_expiration_date: Option<Integer>, pub has_protected_content: Option<bool>, pub invite_link: Option<String>, pub linked_chat_id: Option<Integer>, pub message_auto_delete_time: Option<Integer>, pub photo: Option<ChatPhoto>, pub pinned_message: Option<Box<Message>>, pub profile_accent_color: Option<ProfileAccentColor>, pub profile_background_custom_emoji_id: Option<String>, pub username: Option<ChatUsername>,
}
Expand description

Represents a channel chat.

Fields§

§id: ChatPeerId

Unique identifier of the channel.

§title: String

Title of the channel.

§accent_color: Option<AccentColor>

Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview.

Returned only in crate::types::GetChat.

§active_usernames: Option<Vec<String>>

List of all active channel usernames.

Returned only in crate::types::GetChat.

§available_reactions: Option<Vec<ReactionType>>

List of available reactions allowed in the chat.

If omitted, then all emoji reactions are allowed.

Returned only in crate::types::GetChat.

§background_custom_emoji_id: Option<String>

Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background.

Returned only in crate::types::GetChat.

§description: Option<String>

Description of the channel.

Returned only in crate::types::GetChat.

§emoji_status_custom_emoji_id: Option<String>

Custom emoji identifier of emoji status.

Returned only in crate::types::GetChat.

§emoji_status_expiration_date: Option<Integer>

Expiration date of the emoji status of in Unix time, if any.

Returned only in crate::types::GetChat.

§has_protected_content: Option<bool>

Indicates whether messages from the channel can’t be forwarded to other chats.

Returned only in crate::types::GetChat.

§invite_link: Option<String>

Invite link for the channel.

Returned only in crate::types::GetChat.

§linked_chat_id: Option<Integer>

Unique identifier of a linked discussion group.

Returned only in crate::types::GetChat.

§message_auto_delete_time: Option<Integer>

The time after which all messages sent to the channel will be automatically deleted; in seconds.

Returned only in crate::types::GetChat.

§photo: Option<ChatPhoto>

Photo associated with the channel.

Returned only in crate::types::GetChat.

§pinned_message: Option<Box<Message>>

Latest pinned message in the channel.

Returned only in crate::types::GetChat.

§profile_accent_color: Option<ProfileAccentColor>

Identifier of the accent color for the chat’s profile background.

Returned only in crate::types::GetChat.

§profile_background_custom_emoji_id: Option<String>

Custom emoji identifier of the emoji chosen by the chat for its profile background.

Returned only in crate::types::GetChat.

§username: Option<ChatUsername>

Username of the channel.

Implementations§

source§

impl ChannelChat

source

pub fn new<A, B>(id: A, title: B) -> Self
where A: Into<ChatPeerId>, B: Into<String>,

Creates a new ChannelChat.

§Arguments
  • id - Unique identifier of the channel.
  • title - Title of the channel.
source

pub fn with_accent_color(self, value: AccentColor) -> Self

Sets a new accent color.

§Arguments
  • value - Accent color for the chat.
source

pub fn with_active_usernames<A, B>(self, value: A) -> Self
where A: IntoIterator<Item = B>, B: Into<String>,

Sets a new list of active usernames.

§Arguments
  • value - The list of all active channel usernames.
source

pub fn with_available_reactions<T>(self, value: T) -> Self
where T: IntoIterator<Item = ReactionType>,

Sets a new list of available reactions.

§Arguments

value - The list of all available reactions.

source

pub fn with_background_custom_emoji_id<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new custom emoji identifier for the message background.

§Arguments
  • value - Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background.
source

pub fn with_description<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new description

§Arguments
  • value - The description of the channel.
source

pub fn with_emoji_status_custom_emoji_id<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new custom emoji identifier of emoji status.

§Arguments
  • value - Emoji identifier.
source

pub fn with_emoji_status_expiration_date(self, value: Integer) -> Self

Sets a new emoji status expiration date.

§Arguments
  • value - Unix timestamp; in seconds.
source

pub fn with_has_protected_content(self, value: bool) -> Self

Sets a new value for a has_protected_content flag.

§Arguments
  • value - Indicates whether messages from the chat can’t be forwarded to other chats.

Sets a new invite link.

§Arguments
  • value - The invite link for the channel.
source

pub fn with_linked_chat_id(self, value: Integer) -> Self

Sets a new linked chat ID.

§Arguments
  • value - Unique identifier of the linked discussion group.
source

pub fn with_message_auto_delete_time(self, value: Integer) -> Self

Sets a new message auto-delete time.

§Arguments
  • value - Value in seconds after which all messages sent to the chat will be automatically deleted.
source

pub fn with_photo(self, value: ChatPhoto) -> Self

Sets a new photo.

§Arguments
  • value - Photo associated with the channel.
source

pub fn with_pinned_message(self, value: Message) -> Self

Sets a new pinned message.

§Arguments
  • value - Latest pinned message in the channel.
source

pub fn with_profile_accent_color(self, value: ProfileAccentColor) -> Self

Sets a new profile accent color.

§Arguments
  • value - Accent color for the chat’s profile background.
source

pub fn with_profile_background_custom_emoji_id<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new custom emoji identifer for the chat’s profile background.

§Arguments
  • value - Custom emoji identifier of the emoji chosen by the chat for its profile background.
source

pub fn with_username<T>(self, value: T) -> Self
where T: Into<ChatUsername>,

Sets a new username.

§Arguments
  • value - Username of the channel.

Trait Implementations§

source§

impl Clone for ChannelChat

source§

fn clone(&self) -> ChannelChat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChannelChat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ChannelChat

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ChannelChat> for Chat

source§

fn from(original: ChannelChat) -> Chat

Converts to this type from the input type.
source§

impl PartialEq for ChannelChat

source§

fn eq(&self, other: &ChannelChat) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ChannelChat

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ChannelChat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,