pub struct RestrictChatMember {
pub chat_id: ChatId,
pub user_id: i64,
pub permissions: ChatPermissions,
pub until_date: Option<u64>,
}Expand description
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. 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
permissions: ChatPermissionsA JSON-serialized object for new user permissions
until_date: Option<u64>Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
Implementations§
Source§impl RestrictChatMember
impl RestrictChatMember
Sourcepub fn new(
chat_id: impl Into<ChatId>,
user_id: i64,
permissions: ChatPermissions,
) -> Self
pub fn new( chat_id: impl Into<ChatId>, user_id: i64, permissions: ChatPermissions, ) -> Self
Create a new restrictChatMember request
Sourcepub fn until_date(self, date: u64) -> Self
pub fn until_date(self, date: u64) -> Self
Set the date at which the restriction wil be lifted
Trait Implementations§
Source§impl Clone for RestrictChatMember
impl Clone for RestrictChatMember
Source§fn clone(&self) -> RestrictChatMember
fn clone(&self) -> RestrictChatMember
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more