Recognize VIP badge as Special Roles #44

Merged
modulatingforce merged 9 commits from vip-badge into main 2024-03-25 22:38:02 -04:00
2 changed files with 14 additions and 3 deletions
Showing only changes of commit 1129e0d28a - Show all commits

View file

@ -143,6 +143,8 @@ pub async fn init(mgr: Arc<ModulesManager>) {
requestor_badge_mut = Some(ChatBadge::Mod);
} else if b.name == "broadcaster" {
requestor_badge_mut = Some(ChatBadge::Broadcaster);
} else if b.name == "vip" {
requestor_badge_mut = Some(ChatBadge::VIP);
}
}
@ -330,6 +332,8 @@ pub async fn init(mgr: Arc<ModulesManager>) {
requestor_badge_mut = Some(ChatBadge::Mod);
} else if b.name == "broadcaster" {
requestor_badge_mut = Some(ChatBadge::Broadcaster);
} else if b.name == "vip" {
requestor_badge_mut = Some(ChatBadge::VIP);
}
}

View file

@ -127,8 +127,10 @@ pub async fn init(mgr: Arc<ModulesManager>) {
sender_badge = Some(ChatBadge::Mod);
} else if b.name == "broadcaster" {
sender_badge = Some(ChatBadge::Broadcaster);
} else if b.name == "vip" {
sender_badge = Some(ChatBadge::VIP);
}
}
};
let targetchnl = params.msg.channel_login.to_lowercase();
@ -327,8 +329,10 @@ pub async fn init(mgr: Arc<ModulesManager>) {
sender_badge_mut = Some(ChatBadge::Mod);
} else if b.name == "broadcaster" {
sender_badge_mut = Some(ChatBadge::Broadcaster);
} else if b.name == "vip" {
sender_badge_mut = Some(ChatBadge::VIP);
}
}
};
let sender_badge = sender_badge_mut;
@ -608,6 +612,7 @@ pub struct IdentityManager {
pub enum ChatBadge {
Broadcaster,
Mod,
VIP,
}
impl IdentityManager {
@ -687,8 +692,10 @@ impl IdentityManager {
sender_badge = Some(ChatBadge::Mod);
} else if b.name == "broadcaster" {
sender_badge = Some(ChatBadge::Broadcaster);
} else if b.name == "vip" {
sender_badge = Some(ChatBadge::VIP);
}
}
};
self.can_user_run(
msg.sender.name.to_owned(),