feat(id): add user_id check
This commit is contained in:
parent
f81bc8d3ce
commit
2c7abf251f
|
@ -24,7 +24,10 @@ pub async fn ban_member(
|
||||||
|
|
||||||
sleep(DurationSleep::from_millis(delay)).await;
|
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 };
|
let callback = || async { bot.send(BanChatMember::new(chat_id, user_id)).await };
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,10 @@ pub async fn mute_member(
|
||||||
) -> HandlerResult {
|
) -> HandlerResult {
|
||||||
let (bot, message, mut sender_builder): ExtractedEntityData = handler_entity.extract();
|
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;
|
sleep(Duration::from_millis(time.1)).await;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue