diff --git a/src/ListeningTask/GroupMessageTask.cs b/src/ListeningTask/GroupMessageTask.cs index f6f4a8b..5b105cf 100644 --- a/src/ListeningTask/GroupMessageTask.cs +++ b/src/ListeningTask/GroupMessageTask.cs @@ -569,7 +569,7 @@ namespace Milimoe.RainBOT.ListeningTask IEnumerable temp_at = e.message.Where(m => m.type == "at").Cast().Where(m => m.data.qq == $"{GeneralSettings.BotQQ}"); if (temp_at.Any()) { - if (GeneralSettings.IsReverseAt && e.CheckThrow(GeneralSettings.PReverseAt, out dice)) + if (GeneralSettings.IsReverseAt && !Ignore.ReverseAtIgnore.Contains(e.user_id) && e.CheckThrow(GeneralSettings.PReverseAt, out dice)) { Bot.ColorfulCheckPass(sender, "反向艾特", dice, GeneralSettings.PReverseAt); foreach (AtMessage at in temp_at) diff --git a/src/Settings/Ignore.cs b/src/Settings/Ignore.cs index f152d70..028e6c8 100644 --- a/src/Settings/Ignore.cs +++ b/src/Settings/Ignore.cs @@ -15,6 +15,8 @@ namespace Milimoe.RainBOT.Settings public static List RepeatQQIgnore { get; set; } = []; + public static List ReverseAtIgnore { get; set; } = []; + public static PluginConfig Configs { get; set; } = new("rainbot", "ignore"); public static void InitIgnore() @@ -37,6 +39,10 @@ namespace Milimoe.RainBOT.Settings { RepeatQQIgnore = (List)value; } + if (configs.TryGetValue("ReverseAtIgnore", out value) && value != null) + { + ReverseAtIgnore = (List)value; + } } public static void SaveConfig() @@ -45,6 +51,7 @@ namespace Milimoe.RainBOT.Settings Configs.Add("CallBrotherQQIgnore", CallBrotherQQIgnore); Configs.Add("QQGroupIgnore", QQGroupIgnore); Configs.Add("RepeatQQIgnore", RepeatQQIgnore); + Configs.Add("ReverseAtIgnore", ReverseAtIgnore); Configs.Save(); } @@ -80,6 +87,13 @@ namespace Milimoe.RainBOT.Settings else RepeatQQIgnore.Remove(lv); } break; + case "reverseatignore": + if (long.TryParse(strv, out lv)) + { + if (isadd) ReverseAtIgnore.Add(lv); + else ReverseAtIgnore.Remove(lv); + } + break; default: return false; } @@ -108,6 +122,9 @@ namespace Milimoe.RainBOT.Settings case "repeatqqignore": list = RepeatQQIgnore.Select(x => x.ToString()).ToList(); break; + case "reverseatignore": + list = ReverseAtIgnore.Select(x => x.ToString()).ToList(); + break; } string msg = list.Count > 0 ? "列表" + group + "拥有以下成员:" + "\r\n" + string.Join("\r\n", list) : "此列表不存在或没有任何成员。"; _ = isgroup ? Bot.SendGroupMessage(target, "显示列表成员", msg) : Bot.SendFriendMessage(target, "显示列表成员", msg); diff --git a/src/Settings/OSMCore.cs b/src/Settings/OSMCore.cs index 3930b77..4daaa11 100644 --- a/src/Settings/OSMCore.cs +++ b/src/Settings/OSMCore.cs @@ -3,8 +3,8 @@ public class OSMCore { public const string version = "v1.0"; - public const string version2 = "Patch8 Test1"; - public const string time = "July 6th, 2024"; + public const string version2 = "Patch8 Test2"; + public const string time = "July 8th, 2024"; public static string Info => $"OSM Core {version} {version2}\r\nAuthor: Milimoe\r\nBuilt on {time}\r\nSee: https://github.com/milimoe"; }