Struct tgbot::types::SupergroupChat

source ·
pub struct SupergroupChat {
Show 31 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 can_set_sticker_set: Option<bool>, pub custom_emoji_sticker_set_name: Option<String>, pub description: Option<String>, pub emoji_status_custom_emoji_id: Option<String>, pub emoji_status_expiration_date: Option<Integer>, pub has_aggressive_anti_spam_enabled: Option<bool>, pub has_hidden_members: Option<bool>, pub has_protected_content: Option<bool>, pub has_visible_history: Option<bool>, pub invite_link: Option<String>, pub is_forum: Option<bool>, pub join_by_request: Option<bool>, pub join_to_send_messages: Option<bool>, pub linked_chat_id: Option<Integer>, pub location: Option<ChatLocation>, pub message_auto_delete_time: Option<Integer>, pub permissions: Option<ChatPermissions>, 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 slow_mode_delay: Option<Integer>, pub sticker_set_name: Option<String>, pub unrestrict_boost_count: Option<Integer>, pub username: Option<ChatUsername>,
}
Expand description

Represents a supergroup chat.

Fields§

§id: ChatPeerId

Unique identifier of the supergroup.

§title: String

Title of the supergroup.

§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 supergroup 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.

§can_set_sticker_set: Option<bool>

Indicates whether the bot can change the supergroup sticker set.

Returned only in crate::types::GetChat.

§custom_emoji_sticker_set_name: Option<String>

The name of the group’s custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.

Returned only in crate::types::GetChat.

§description: Option<String>

Description of the supergroup.

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_aggressive_anti_spam_enabled: Option<bool>

Indicates whether aggressive anti-spam checks are enabled in the supergroup.

The field is only available to chat administrators. Returned only in crate::types::GetChat.

§has_hidden_members: Option<bool>

Indicates whether non-administrators can only get the list of bots and administrators in the supergroup.

Returned only in crate::types::GetChat.

§has_protected_content: Option<bool>

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

Returned only in crate::types::GetChat.

§has_visible_history: Option<bool>

Whether new chat members will have access to old messages; available only to chat administrators.

Returned only in crate::types::GetChat.

§invite_link: Option<String>

Invite link for the supergroup.

Returned only in crate::types::GetChat.

§is_forum: Option<bool>

Indicates whether the supergroup is a forum (has topics enabled).

§join_by_request: Option<bool>

Indicates whether all users directly joining the supergroup need to be approved by administrators.

Returned only in crate::types::GetChat.

§join_to_send_messages: Option<bool>

Indicates whether users need to join the supergroup before they can send messages.

Returned only in crate::types::GetChat.

§linked_chat_id: Option<Integer>

Unique identifier of the linked channel.

Returned only in crate::types::GetChat.

§location: Option<ChatLocation>

The location to which the supergroup is connected.

Returned only in crate::types::GetChat.

§message_auto_delete_time: Option<Integer>

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

Returned only in crate::types::GetChat.

§permissions: Option<ChatPermissions>

Default supergroup member permissions.

Returned only in crate::types::GetChat.

§photo: Option<ChatPhoto>

Photo associated with the supergroup.

Returned only in crate::types::GetChat.

§pinned_message: Option<Box<Message>>

Latest pinned message in the supergroup.

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.

§slow_mode_delay: Option<Integer>

The minimum allowed delay between consecutive messages sent by each unprivileged user.

Returned only in crate::types::GetChat.

§sticker_set_name: Option<String>

Name of supergroup sticker set.

Returned only in crate::types::GetChat.

§unrestrict_boost_count: Option<Integer>

The minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions.

Returned only in crate::types::GetChat.

§username: Option<ChatUsername>

Username of the supergroup.

Implementations§

source§

impl SupergroupChat

source

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

Creates a new SupergroupChat.

§Arguments
  • id - Unique identifier of the supergroup.
  • title - Title of the supergroup.
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 - Active 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_can_set_sticker_set(self, value: bool) -> Self

Sets a value for a can_set_sticker_set flag.

§Arguments
  • value - Indicates whether the bot can change the supergroup sticker set.
source

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

Sets a new custom emoji sticker set name

§Arguments

value - Name of of the group’s custom emoji sticker set.

source

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

Sets a new description.

§Arguments
  • value - Description of the supergroup.
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_aggressive_anti_spam_enabled(self, value: bool) -> Self

Sets a new value for a has_aggressive_anti_spam_enabled flag.

§Arguments
  • value - Indicates whether aggressive anti-spam checks are enabled in the supergroup.
source

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

Sets a new value for a has_hidden_members flag.

§Arguments
  • value - Indicates whether non-administrators can only get the list of bots and administrators in the supergroup.
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.
source

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

Sets a new value for a has_visible_history flag.

§Arguments
  • value - Indicates whether new chat members will have access to old messages; available only to chat administrators.

Sets a new invite link.

§Arguments
  • value - Invite link for the supergroup.
source

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

Sets a new value for an is_forum flag.

§Arguments
  • value - Indicates whether the supergroup is a forum (has topics enabled).
source

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

Sets a new value for a join_by_request flag.

§Arguments
  • value - Indicates whether all users directly joining the supergroup need to be approved by administrators.
source

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

Sets a new value for a join_to_send_messages flag.

§Arguments
  • value - Indicates whether users need to join the supergroup before they can send messages.
source

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

Sets a new linked chat ID.

§Arguments
  • value - Chat ID.
source

pub fn with_location(self, value: ChatLocation) -> Self

Sets a new supergroup location.

§Arguments
  • value - Location.
source

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

Sets a new message auto-delete time.

§Arguments
  • value - Time in seconds.
source

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

Sets a new photo.

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

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

Sets a new latest pinned message.

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

pub fn with_permissions(self, value: ChatPermissions) -> Self

Sets a new permissions.

§Arguments
  • value - Permissions.
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_slow_mode_delay(self, value: Integer) -> Self

Sets a new slow mode delay.

§Arguments
  • value - Delay in seconds.
source

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

Sets a new sticker set name.

§Arguments
  • value - Name of the sticker set.
source

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

Sets a new unrestrict boost count.

§Arguments
  • value - Number of boosts.
source

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

Sets a new username.

§Arguments
  • value - Username of the supergroup.

Trait Implementations§

source§

impl Clone for SupergroupChat

source§

fn clone(&self) -> SupergroupChat

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 SupergroupChat

source§

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

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

impl<'de> Deserialize<'de> for SupergroupChat

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<SupergroupChat> for Chat

source§

fn from(original: SupergroupChat) -> Chat

Converts to this type from the input type.
source§

impl PartialEq for SupergroupChat

source§

fn eq(&self, other: &SupergroupChat) -> 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 SupergroupChat

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 SupergroupChat

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>,