pub struct BanChatMember {
pub chat_id: Recipient,
pub user_id: UserId,
pub until_date: Option<DateTime<Utc>>,
pub revoke_messages: Option<bool>,
}Expand description
Use this method to ban a user in a group, a supergroup or a channel. 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. Returns True on success.
Fields§
§chat_id: RecipientUnique identifier for the target chat or username of the target channel (in the format @channelusername)
user_id: UserIdUnique identifier of the target user
until_date: Option<DateTime<Utc>>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
revoke_messages: Option<bool>Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.
Implementations§
Trait Implementations§
Source§impl Clone for BanChatMember
impl Clone for BanChatMember
Source§impl Debug for BanChatMember
impl Debug for BanChatMember
impl Eq for BanChatMember
Source§impl Hash for BanChatMember
impl Hash for BanChatMember
Source§impl PartialEq for BanChatMember
impl PartialEq for BanChatMember
Source§impl Payload for BanChatMember
impl Payload for BanChatMember
Source§fn timeout_hint(&self) -> Option<Duration>
fn timeout_hint(&self) -> Option<Duration>
GetUpdates with
big timeout), the minimum timeout that should be used.Source§impl Serialize for BanChatMember
impl Serialize for BanChatMember
impl StructuralPartialEq for BanChatMember
Auto Trait Implementations§
impl Forget for BanChatMember
impl Freeze for BanChatMember
impl RefUnwindSafe for BanChatMember
impl Send for BanChatMember
impl Sync for BanChatMember
impl Unpin for BanChatMember
impl UnsafeUnpin for BanChatMember
impl UnwindSafe for BanChatMember
Blanket Implementations§
Source§impl<P> BanChatMemberSetters for Pwhere
P: HasPayload<Payload = BanChatMember>,
impl<P> BanChatMemberSetters for Pwhere
P: HasPayload<Payload = BanChatMember>,
Source§fn until_date<T>(self, value: T) -> Self
fn until_date<T>(self, value: T) -> Self
until_date field.Source§fn revoke_messages(self, value: bool) -> Self
fn revoke_messages(self, value: bool) -> Self
revoke_messages field.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<P> HasPayload for Pwhere
P: Payload,
impl<P> HasPayload for Pwhere
P: Payload,
Source§fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
Source§fn payload_ref(&self) -> &<P as HasPayload>::Payload
fn payload_ref(&self) -> &<P as HasPayload>::Payload
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> ⓘ
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> ⓘ
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