Admin checks have been implemented in "Inner middleware"
This commit is contained in:
parent
d803f6931f
commit
ac9fbcf344
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue