[][src]Struct tgbot::types::ChatPermissions

pub struct ChatPermissions {
    pub can_send_messages: Option<bool>,
    pub can_send_media_messages: Option<bool>,
    pub can_send_polls: Option<bool>,
    pub can_send_other_messages: Option<bool>,
    pub can_add_web_page_previews: Option<bool>,
    pub can_change_info: Option<bool>,
    pub can_invite_users: Option<bool>,
    pub can_pin_messages: Option<bool>,
}

Describes actions that a non-administrator user is allowed to take in a chat

Fields

can_send_messages: Option<bool>

True, if the user is allowed to send text messages, contacts, locations and venues

can_send_media_messages: Option<bool>

True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages

can_send_polls: Option<bool>

True, if the user is allowed to send polls, implies can_send_messages

can_send_other_messages: Option<bool>

True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages

can_add_web_page_previews: Option<bool>

True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages

can_change_info: Option<bool>

True, if the user is allowed to change the chat title, photo and other settings

Ignored in public supergroups

can_invite_users: Option<bool>

True, if the user is allowed to invite new users to the chat

can_pin_messages: Option<bool>

True, if the user is allowed to pin messages

Ignored in public supergroups

Methods

impl ChatPermissions[src]

pub fn restricted() -> Self[src]

Restrict everything

pub fn allowed() -> Self[src]

Allow everything

pub fn with_send_messages(self, flag: bool) -> Self[src]

Permission to send text messages, contacts, locations and venues

pub fn with_send_media_messages(self, flag: bool) -> Self[src]

Permission to send audios, documents, photos, videos, video notes and voice notes

pub fn with_send_polls(self, flag: bool) -> Self[src]

Permission to send polls

pub fn with_send_other_messages(self, flag: bool) -> Self[src]

Permission to send animations, games, stickers and use inline bots

pub fn with_add_web_page_previews(self, flag: bool) -> Self[src]

Permission add web page previews to messages

pub fn with_change_info(self, flag: bool) -> Self[src]

Permission to change the chat title, photo and other settings

pub fn with_invite_users(self, flag: bool) -> Self[src]

Permission to invite new users to the chat

pub fn with_pin_messages(self, flag: bool) -> Self[src]

Permission to pin messages

Trait Implementations

impl Clone for ChatPermissions[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for ChatPermissions[src]

impl Debug for ChatPermissions[src]

impl Serialize for ChatPermissions[src]

impl<'de> Deserialize<'de> for ChatPermissions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

impl<T> Erased for T