[][src]Struct tbot::types::chat::Permissions

pub struct Permissions {
    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.

This struct is a representation of ChatPermissions.

Non-exhaustiveness

Users should not match this struct exhaustively. New fields added to it are not considered a breaking change per tbot's breaking change policy.

Fields

can_send_messages: Option<bool>

true if the user can send text messages, contacts, locations and venues.

can_send_media_messages: Option<bool>

true if the user can send audios, documents, photos, videos, video notes and voice notes. Implies can_send_messages.

can_send_polls: Option<bool>

true if the user can send polls. Implies can_send_messages.

can_send_other_messages: Option<bool>

true if the user can use inline bots and send animations, games and stickers. Implies can_send_media_messages.

can_add_web_page_previews: Option<bool>

true if the user can add web page previews. Implies can_send_media_messages.

can_change_info: Option<bool>

true if the user can change the chat information. Ignored in public supergroups.

can_invite_users: Option<bool>

true if the user can invite new users.

can_pin_messages: Option<bool>

true is the user can pin messages. Ignored in public supegroups.

Methods

impl Permissions[src]

pub fn new() -> Self[src]

Constructs Permissions with all fields set to None.

pub fn can_send_messages(self, can_send: bool) -> Self[src]

Configures if the user can send messages.

pub fn can_send_media_messages(self, can_send: bool) -> Self[src]

Configures if the user can send media messages.

pub fn can_send_polls(self, can_send: bool) -> Self[src]

Configures if the user can send polls.

pub fn can_send_other_messages(self, can_send: bool) -> Self[src]

Configures if the user can send other messages not covered by other permissions.

pub fn can_add_web_page_previews(self, can_add: bool) -> Self[src]

Configures if the user can add webpage previews.

pub fn can_change_info(self, can_change: bool) -> Self[src]

Configures if the user can change chat information.

pub fn can_invite_users(self, can_invite: bool) -> Self[src]

Configures if the user can invite new users to the chat.

pub fn can_pin_messages(self, can_pin: bool) -> Self[src]

Configures if the user can pin messages.

Trait Implementations

impl PartialEq<Permissions> for Permissions[src]

impl Default for Permissions[src]

impl Clone for Permissions[src]

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

Performs copy-assignment from source. Read more

impl Eq for Permissions[src]

impl Copy for Permissions[src]

impl Debug for Permissions[src]

impl Hash for Permissions[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for Permissions[src]

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

Auto Trait Implementations

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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