pub struct BanChatMember {
pub chat_id: ChatId,
pub user_id: i64,
pub until_date: Option<u64>,
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 administrator rights. Returns True on success.
Fields§
§chat_id: ChatIdUnique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
user_id: i64Unique identifier of the target user
until_date: Option<u64>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. Applied for supergroups and channels only.
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§
Source§impl BanChatMember
impl BanChatMember
Sourcepub fn new(chat_id: impl Into<ChatId>, user_id: i64) -> Self
pub fn new(chat_id: impl Into<ChatId>, user_id: i64) -> Self
Create a new banChatMember request
Sourcepub fn until_date(self, date: u64) -> Self
pub fn until_date(self, date: u64) -> Self
Set the date at which the user will be unbanned
Sourcepub fn revoke_messages(self) -> Self
pub fn revoke_messages(self) -> Self
Set revoke_messages to true
Trait Implementations§
Source§impl Clone for BanChatMember
impl Clone for BanChatMember
Source§fn clone(&self) -> BanChatMember
fn clone(&self) -> BanChatMember
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more