feat(id): add user_id check

This commit is contained in:
doryan 2024-08-31 23:30:17 +04:00
parent f81bc8d3ce
commit 2c7abf251f
2 changed files with 8 additions and 2 deletions

View File

@ -24,7 +24,10 @@ pub async fn ban_member(
sleep(DurationSleep::from_millis(delay)).await;
let user_id: i64 = user.get_id().unwrap();
let user_id: i64 = match user.get_id() {
Some(id) => id,
None => return Ok(EventReturn::Skip)
};
let callback = || async { bot.send(BanChatMember::new(chat_id, user_id)).await };

View File

@ -25,7 +25,10 @@ pub async fn mute_member(
) -> HandlerResult {
let (bot, message, mut sender_builder): ExtractedEntityData = handler_entity.extract();
let user_id: i64 = user.get_id().unwrap();
let user_id: i64 = match user.get_id() {
Some(id) => id,
None => return Ok(EventReturn::Skip)
};
sleep(Duration::from_millis(time.1)).await;