[][src]Struct rutebot::requests::PromoteChatMember

pub struct PromoteChatMember<'a> {
    pub chat_id: ChatId<'a>,
    pub user_id: i64,
    pub can_change_info: Option<bool>,
    pub can_post_messages: Option<bool>,
    pub can_edit_messages: Option<bool>,
    pub can_delete_messages: Option<bool>,
    pub can_invite_users: Option<bool>,
    pub can_restrict_members: Option<bool>,
    pub can_pin_messages: Option<bool>,
    pub can_promote_members: Option<bool>,
}

Use this struct to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. Returns True on success

Fields

chat_id: ChatId<'a>

Unique identifier for the target group or username of the target supergroup or channel

user_id: i64

Unique identifier of the target user

can_change_info: Option<bool>

Pass True, if the administrator can change chat title, photo and other settings

can_post_messages: Option<bool>

Pass True, if the administrator can create channel posts, channels only

can_edit_messages: Option<bool>

Pass True, if the administrator can edit messages of other users and can pin messages, channels only

can_delete_messages: Option<bool>

Pass True, if the administrator can delete messages of other users

can_invite_users: Option<bool>

Pass True, if the administrator can invite new users to the chat

can_restrict_members: Option<bool>

Pass True, if the administrator can restrict, ban or unban chat members

can_pin_messages: Option<bool>

Pass True, if the administrator can pin messages, supergroups only

can_promote_members: Option<bool>

Pass True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)

Methods

impl<'a> PromoteChatMember<'a>[src]

pub fn new(chat_id: impl Into<ChatId<'a>>, user_id: i64) -> Self[src]

Trait Implementations

impl<'a> Request for PromoteChatMember<'a>[src]

type ResponseType = bool

fn set_http_request_body(
    self,
    request_builder: Builder
) -> Result<Request<Body>, Error>
[src]

impl<'a> Clone for PromoteChatMember<'a>[src]

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

Performs copy-assignment from source. Read more

impl<'a> Debug for PromoteChatMember<'a>[src]

impl<'a> Serialize for PromoteChatMember<'a>[src]

Auto Trait Implementations

impl<'a> Send for PromoteChatMember<'a>

impl<'a> Sync for PromoteChatMember<'a>

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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