feat(fn): all_admin_member is slice

This commit is contained in:
doryan 2024-08-21 20:56:45 +04:00
parent 352514d2b0
commit e333e401f3

View File

@ -1,7 +1,6 @@
use telers::types::chat_member::ChatMember;
pub fn is_admin(all_admin_members: &Vec<ChatMember>, user_id: i64) -> bool {
//fix: moderators with non full rights can use admin commands now.
pub fn is_admin(all_admin_members: &[ChatMember], user_id: i64) -> bool {
all_admin_members
.iter()
.any(|admin: &ChatMember| match admin {