Admin checks have been implemented in "Inner middleware"

This commit is contained in:
doryan 2024-06-08 03:04:34 +04:00
parent d803f6931f
commit ac9fbcf344

View File

@ -30,11 +30,10 @@ impl InnerMiddleware for AdminCheck {
let chat_id: i64 = message.chat_id().unwrap();
if is_admin(&admins_list, message.from().unwrap()) {
if is_admin(&admins_list, message.from().unwrap().id) {
let response = next(request).await?;
return Ok(response);
} else {
println!("lol");
MessageSender::builder(chat_id)
.text("Недостаточно прав для использования данной команды.")
.build()