Struct tgbot::types::ChatMemberRestricted

source ·
pub struct ChatMemberRestricted {
Show 17 fields pub user: User, pub can_add_web_page_previews: bool, pub can_change_info: bool, pub can_invite_users: bool, pub can_manage_topics: bool, pub can_pin_messages: Option<bool>, pub can_send_audios: Option<bool>, pub can_send_documents: Option<bool>, pub can_send_messages: bool, pub can_send_other_messages: bool, pub can_send_photos: Option<bool>, pub can_send_polls: bool, pub can_send_video_notes: Option<bool>, pub can_send_videos: Option<bool>, pub can_send_voice_notes: Option<bool>, pub is_member: bool, pub until_date: Integer,
}
Expand description

Represents a restricted user.

Fields§

§user: User

Information about the user.

§can_add_web_page_previews: bool

Indicates whether the user may add web page previews to his messages.

§can_change_info: bool

Indicates whether the user allowed to change the chat title, photo and other settings.

§can_invite_users: bool

Indicates whether the user allowed to invite new users to the chat.

§can_manage_topics: bool

Indicates whether the user is allowed to create forum topics.

§can_pin_messages: Option<bool>

Indicates whether the user allowed to pin messages; groups and supergroups only.

§can_send_audios: Option<bool>

Indicates whether the user is allowed to send audios.

§can_send_documents: Option<bool>

Indicates whether the user is allowed to send documents.

§can_send_messages: bool

Indicates whether the user can send text messages, contacts, locations and venues.

§can_send_other_messages: bool

Indicates whether the user can send animations, games, stickers and use inline bots.

§can_send_photos: Option<bool>

Indicates whether the user is allowed to send photos.

§can_send_polls: bool

Indicates whether the user is allowed to send polls.

§can_send_video_notes: Option<bool>

Indicates whether the user is allowed to send video notes.

§can_send_videos: Option<bool>

Indicates whether the user is allowed to send videos.

§can_send_voice_notes: Option<bool>

Indicates whether the user is allowed to send voice notes.

§is_member: bool

Indicates whether the user is a member of the chat at the moment of the request.

§until_date: Integer

Date when restrictions will be lifted for this user; unix time.

Implementations§

source§

impl ChatMemberRestricted

source

pub fn new(user: User, until_date: Integer) -> Self

Creates a new ChatMemberRestricted

§Arguments
  • user - Information about the user.
  • until_date - Date when restrictions will be lifted for this user; unix time.
source

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

Sets a new value for a can_add_web_page_previews flag.

§Arguments
  • value - Indicates whether the user may add web page previews to his messages.
source

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

Sets a new value for a can_change_info flag.

§Arguments
  • value - Indicates whether the user allowed to change the chat title, photo and other settings.
source

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

Sets a new value for a can_invite_users flag.

§Arguments
  • value - Indicates whether the user allowed to invite new users to the chat.
source

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

Sets a new value for a can_manage_topics flag.

§Arguments
  • value - Indicates whether the user is allowed to create forum topics.
source

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

Sets a new value for a can_pin_messages flag.

§Arguments
  • value - Indicates whether the user allowed to pin messages; groups and supergroups only.
source

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

Sets a new value for a can_send_audios flag.

§Arguments
  • value - Indicates whether the user is allowed to send audios.
source

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

Sets a new value for a can_send_documents flag.

§Arguments
  • value - Indicates whether the user is allowed to send documents.
source

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

Sets a new value for a can_send_messages flag.

§Arguments
  • value - Indicates whether the user can send text messages, contacts, locations and venues.
source

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

Sets a new value for a can_send_other_messages flag.

§Arguments
  • value - Indicates whether the user can send animations, games, stickers and use inline bots.
source

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

Sets a new value for a can_send_photos flag.

§Arguments
  • value - Indicates whether the user is allowed to send photos.
source

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

Sets a new value for a can_send_polls flag.

§Arguments
  • value - Indicates whether the user is allowed to send polls.
source

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

Sets a new value for a can_send_video_notes flag.

§Arguments
  • value - Indicates whether the user is allowed to send video notes.
source

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

Sets a new value for a can_send_videos flag.

§Arguments
  • value - Indicates whether the user is allowed to send videos.
source

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

Sets a new value for a can_send_voice_notes flag.

§Arguments
  • value - Indicates whether the user is allowed to send voice notes.
source

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

Sets a new value for an is_member flag.

§Arguments
  • value - Indicates whether the user is a member of the chat at the moment of the request.

Trait Implementations§

source§

impl Clone for ChatMemberRestricted

source§

fn clone(&self) -> ChatMemberRestricted

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 ChatMemberRestricted

source§

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

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

impl<'de> Deserialize<'de> for ChatMemberRestricted

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 PartialEq for ChatMemberRestricted

source§

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

source§

fn partial_cmp(&self, other: &ChatMemberRestricted) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for ChatMemberRestricted

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 ChatMemberRestricted

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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>,

source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,