From 1129e0d28a0779536e6e2d97ac3d64ccc3451640 Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:01:27 -0400 Subject: [PATCH] recognizes VIP badge --- src/core/botmodules.rs | 4 ++++ src/core/identity.rs | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/core/botmodules.rs b/src/core/botmodules.rs index 25206df..188b560 100644 --- a/src/core/botmodules.rs +++ b/src/core/botmodules.rs @@ -143,6 +143,8 @@ pub async fn init(mgr: Arc) { 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) { 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); } } diff --git a/src/core/identity.rs b/src/core/identity.rs index 2fbf56e..03d4a6a 100644 --- a/src/core/identity.rs +++ b/src/core/identity.rs @@ -127,8 +127,10 @@ pub async fn init(mgr: Arc) { 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) { 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(),