Struct carapax::types::BanChatMember
source · pub struct BanChatMember { /* private fields */ }
Expand description
Bans a user in a chat.
In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first.
The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Implementations§
source§impl BanChatMember
impl BanChatMember
sourcepub fn new<T>(chat_id: T, user_id: i64) -> BanChatMember
pub fn new<T>(chat_id: T, user_id: i64) -> BanChatMember
Creates a new BanChatMember
.
§Arguments
chat_id
- Unique identifier of the target chat.user_id
- Unique identifier of the target user.
sourcepub fn with_revoke_messages(self, value: bool) -> BanChatMember
pub fn with_revoke_messages(self, value: bool) -> BanChatMember
Sets a new value for a revoke_messages
flag.
§Arguments
value
- Delete all messages from the chat for the user that is being removed; iffalse
, the user will be able to see messages in the group that were sent before the user was removed; alwaystrue
for supergroups and channels.
sourcepub fn with_until_date(self, value: i64) -> BanChatMember
pub fn with_until_date(self, value: i64) -> BanChatMember
Sets a new until date.
§Arguments
value
- The date when the user will be unbanned, unix time.
If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever.
Trait Implementations§
source§impl Clone for BanChatMember
impl Clone for BanChatMember
source§fn clone(&self) -> BanChatMember
fn clone(&self) -> BanChatMember
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BanChatMember
impl Debug for BanChatMember
source§impl Method for BanChatMember
impl Method for BanChatMember
source§impl Serialize for BanChatMember
impl Serialize for BanChatMember
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for BanChatMember
impl RefUnwindSafe for BanChatMember
impl Send for BanChatMember
impl Sync for BanChatMember
impl Unpin for BanChatMember
impl UnwindSafe for BanChatMember
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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