From dc11e3de530df93951cf01ab7ef3e08313984441 Mon Sep 17 00:00:00 2001 From: milimoe Date: Mon, 1 Jul 2024 20:38:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAlong=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ListeningTask/GroupMessageTask.cs | 2 +- src/Settings/Ignore.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ListeningTask/GroupMessageTask.cs b/src/ListeningTask/GroupMessageTask.cs index fa588e2..b379a2f 100644 --- a/src/ListeningTask/GroupMessageTask.cs +++ b/src/ListeningTask/GroupMessageTask.cs @@ -557,7 +557,7 @@ namespace Milimoe.RainBOT.ListeningTask } // 随机叫哥 - if (GeneralSettings.IsCallBrother && e.CheckThrow(GeneralSettings.PCallBrother, out dice)) + if (GeneralSettings.IsCallBrother && !Ignore.CallBrotherQQIgnore.Contains(e.user_id) && e.CheckThrow(GeneralSettings.PCallBrother, out dice)) { int delay = GeneralSettings.RepeatDelay[0] + new Random().Next(GeneralSettings.RepeatDelay[1]); Bot.ColorfulCheckPass(sender, "随机叫哥", dice, GeneralSettings.PCallBrother, delay); diff --git a/src/Settings/Ignore.cs b/src/Settings/Ignore.cs index 984881e..b2a58a7 100644 --- a/src/Settings/Ignore.cs +++ b/src/Settings/Ignore.cs @@ -6,7 +6,7 @@ namespace Milimoe.RainBOT.Settings { public static HashSet RepeatIgnore { get; set; } = []; - public static List CallBrotherQQIgnore { get; set; } = []; + public static List CallBrotherQQIgnore { get; set; } = []; /// /// 这个属性暂时没用到 标记一下 @@ -25,7 +25,7 @@ namespace Milimoe.RainBOT.Settings } if (configs.TryGetValue("CallBrotherQQIgnore", out value) && value != null) { - CallBrotherQQIgnore = new List((List)value); + CallBrotherQQIgnore = new List((List)value); } if (configs.TryGetValue("QQGroupIgnore", out value) && value != null) { @@ -52,8 +52,8 @@ namespace Milimoe.RainBOT.Settings else RepeatIgnore.Remove((string)value); break; case "callbrotherqqignore": - if (isadd) CallBrotherQQIgnore.Add((string)value); - else CallBrotherQQIgnore.Remove((string)value); + if (isadd) CallBrotherQQIgnore.Add((long)value); + else CallBrotherQQIgnore.Remove((long)value); break; case "qqgroupignore": if (isadd) QQGroupIgnore.Add((long)value); @@ -79,7 +79,7 @@ namespace Milimoe.RainBOT.Settings list = [..RepeatIgnore]; break; case "callbrotherqqignore": - list = CallBrotherQQIgnore; + list = CallBrotherQQIgnore.Select(x => x.ToString()).ToList(); break; case "qqgroupignore": list = QQGroupIgnore.Select(x => x.ToString()).ToList();