pub struct PromoteChatMember { /* private fields */ }
Expand description

Promotes or demotes a user in a chat.

The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

Implementations§

source§

impl PromoteChatMember

source

pub fn new<T>(chat_id: T, user_id: Integer) -> Self
where T: Into<ChatId>,

Creates a new PromoteChatMember

§Arguments
  • chat_id - Unique identifier of the target chat.
  • user_id - Unique identifier of the target user.
source

pub fn promote_all(self) -> Self

Promotes all privileges.

source

pub fn demote_all(self) -> Self

Demotes all privileges.

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 administrator can change chat title, photo and other settings.
source

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

Sets a new value for a can_delete_messages flag.

§Arguments
  • value - Indicates whether the administrator can delete messages of other users.
source

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

Sets a new value for a can_delete_stories flag.

§Arguments
  • value - Indicates whether the administrator can delete stories posted by other users; channels only.
source

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

Sets a new value for a can_edit_messages flag.

§Arguments
  • value - Indicates whether the administrator can edit messages of other users and can pin messages; channels only.
source

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

Sets a new value for a can_edit_stories flag.

§Arguments
  • value - Indicates whether the administrator can edit stories posted by other users; channels only.
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 administrator can invite new users to the chat.
source

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

Sets a new value for a can_manage_chat flag.

§Arguments
  • value - Indicates whether the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode; implied by any other administrator privilege.
source

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

Sets a new value for a can_manage_topics flag.

§Arguments
  • value - User is allowed to create, rename, close, and reopen forum topics; supergroups only.
source

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

Sets a new value for a can_manage_video_chats flag.

§Arguments
  • value - Indicates whether the administrator can manage video chats; supergroups only.
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 administrator can pin messages; supergroups only.
source

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

Sets a new value for a can_post_messages flag.

§Arguments
  • value - Indicates whether the administrator can create channel posts; channels only.
source

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

Sets a new value for a can_post_stories flag.

§Arguments
  • value - Indicates whether the administrator can post stories in the channel; channels only.
source

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

Sets a new value for a can_promote_members flag.

§Arguments
  • value - Indicates whether 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).
source

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

Sets a new value for a can_restrict_members flag.

§Arguments
  • value - Indicates whether the administrator can restrict, ban or unban chat members.
source

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

Sets a new value for an is_anonymous flag.

§Arguments
  • value - Indicates whether the administrator’s presence in the chat is hidden.

Trait Implementations§

source§

impl Clone for PromoteChatMember

source§

fn clone(&self) -> PromoteChatMember

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 PromoteChatMember

source§

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

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

impl Method for PromoteChatMember

§

type Response = bool

The type representing a successful result in an API response.
source§

fn into_payload(self) -> Payload

Converts the method into a payload for an HTTP request.
source§

impl Serialize for PromoteChatMember

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

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