From 8af4aae0f71dbca36aacefe93531edbc27abc720 Mon Sep 17 00:00:00 2001 From: milimoe Date: Thu, 9 May 2024 23:56:17 +0800 Subject: [PATCH] 1.0 patch4 test --- src/ListeningTask/GroupMessageTask.cs | 12 +++++- src/Main.cs | 11 ++++- src/Settings/Bot.cs | 1 + src/Settings/OSMCore.cs | 4 +- src/Settings/SayNo.cs | 59 +++++++++++++++++++++++++-- 5 files changed, 79 insertions(+), 8 deletions(-) diff --git a/src/ListeningTask/GroupMessageTask.cs b/src/ListeningTask/GroupMessageTask.cs index 1e0aaac..7374349 100644 --- a/src/ListeningTask/GroupMessageTask.cs +++ b/src/ListeningTask/GroupMessageTask.cs @@ -475,7 +475,7 @@ namespace Milimoe.RainBOT.ListeningTask _ = Bot.SendGroupMessage(e.group_id, "随机反驳不", "不可以"); } } - else if (e.detail.Contains('能') && !e.detail.Contains('不') && !e.detail.Contains('技') && !e.detail.Contains('可') && e.CheckThrow(GeneralSettings.PSayNo, out dice)) + else if (e.detail.Contains('能') && !e.detail.Contains('不') && !SayNo.IgnoreTriggerBeforeCan.Any(e.detail.Contains) && e.CheckThrow(GeneralSettings.PSayNo, out dice)) { Bot.ColorfulCheckPass(sender, "随机反驳不", dice, GeneralSettings.PSayNo); if (dice < (GeneralSettings.PSayNo / 2)) @@ -499,6 +499,16 @@ namespace Milimoe.RainBOT.ListeningTask _ = Bot.SendGroupMessage(e.group_id, "随机反驳不", "不可能"); } } + else if (e.detail.Contains('要') && !e.detail.Contains('不') && e.CheckThrow(GeneralSettings.PSayNo, out dice)) + { + Bot.ColorfulCheckPass(sender, "随机反驳不", dice, GeneralSettings.PSayNo); + _ = Bot.SendGroupMessage(e.group_id, "随机反驳不", SayNo.SayWantWords[new Random().Next(SayNo.SayWantWords.Count)]); + } + else if (e.detail.Contains('想') && !e.detail.Contains('不') && e.CheckThrow(GeneralSettings.PSayNo, out dice)) + { + Bot.ColorfulCheckPass(sender, "随机反驳不", dice, GeneralSettings.PSayNo); + _ = Bot.SendGroupMessage(e.group_id, "随机反驳不", SayNo.SayThinkWords[new Random().Next(SayNo.SayThinkWords.Count)]); + } // 反向艾特 IEnumerable temp_at = e.message.Where(m => m.type == "at").Cast().Where(m => m.data.qq == $"{GeneralSettings.BotQQ}"); diff --git a/src/Main.cs b/src/Main.cs index 5f123f2..5e966e3 100644 --- a/src/Main.cs +++ b/src/Main.cs @@ -2,6 +2,7 @@ using Milimoe.OneBot.Model.Content; using Milimoe.OneBot.Model.Message; using Milimoe.OneBot.Model.Other; +using Milimoe.RainBOT.Command; using Milimoe.RainBOT.ListeningTask; using Milimoe.RainBOT.Settings; @@ -197,8 +198,14 @@ try while (true) { - string order = Console.ReadLine()?.ToLower().Trim() ?? ""; - switch (order) + string read = Console.ReadLine() ?? ""; + // OSM指令 + if (read.Length >= 4 && read[..4] == ".osm") + { + MasterCommand.Execute(read, GeneralSettings.Master, false, GeneralSettings.Master, false); + return; + } + switch (read.ToLower().Trim() ?? "") { case "debug on": GeneralSettings.IsDebug = true; diff --git a/src/Settings/Bot.cs b/src/Settings/Bot.cs index 45586f9..0a0b2a4 100644 --- a/src/Settings/Bot.cs +++ b/src/Settings/Bot.cs @@ -282,6 +282,7 @@ namespace Milimoe.RainBOT.Settings SetGroupBanContent content = new(group_id, qq, mute_time); list.Add(content); } + if (unmute) list.Add(new SetGroupBanContent(group_id, GeneralSettings.Master, mute_time)); await SendMessage(SupportedAPI.set_group_ban, group_id, "批量禁言指令", list, true); if (mute_time > 0) { diff --git a/src/Settings/OSMCore.cs b/src/Settings/OSMCore.cs index 8a8970d..e54c047 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 = "Patch3"; - public const string time = "Apr. 12nd, 2024"; + public const string version2 = "Patch4 Test"; + public const string time = "May 9th, 2024"; public static string Info => $"OSM Core {version} {version2}\r\nAuthor: Milimoe\r\nBuilt on {time}\r\nSee: https://github.com/milimoe"; } diff --git a/src/Settings/SayNo.cs b/src/Settings/SayNo.cs index 147d4f0..0a5ec53 100644 --- a/src/Settings/SayNo.cs +++ b/src/Settings/SayNo.cs @@ -27,6 +27,20 @@ "过", "太" ]; + + public static HashSet IgnoreTriggerBeforeCan { get; } = [ + "技", + "可", + "性", + "本", + "来", + "才", + "产", + "高", + "负", + "正", + "潜" + ]; public static HashSet TriggerAfterYes { get; } = [ "吗", @@ -108,7 +122,8 @@ "差不多得了,这不{0}等到啥时候{0}??", "我就不{0},怎么了?", "你不{0}有的是人{0}", - "逆天" + "逆天", + "何出此言?" ]; public static List SayDontHaveWords { get; } = [ @@ -127,7 +142,8 @@ "可是我有{0}", "从来都有{0}", "这还没{0},你想等到你80岁了才有{0}吗?", - "逆天" + "逆天", + "何出此言?" ]; public static List SayNotYesWords { get; } = [ @@ -159,7 +175,44 @@ "我觉得{0}不{0}都那样", "为什么不{0}啊?", "太{0}了", - "爱{0}不{0}" + "爱{0}不{0}", + "何出此言?" + ]; + + public static List SayWantWords { get; } = [ + "你要个叽叭", + "要不了一点", + "真别要吧", + "想要可以直接要", + "要不要关我什么事?", + "OK,顺便带我一个", + "千万别要", + "要不要真无所谓吧", + "我不要", + "太要了", + "你别要", + "感觉……不如《崩坏:星穹铁道》", + "赶紧的,耽误了我玩原神你们都得陪葬", + "喜欢就买下来" + ]; + + public static List SayThinkWords { get; } = [ + "算了吧,最好别想", + "想想就得了", + "梦里啥都有", + "真没人想吧", + "必不想", + "也就你想了,你看这里还有谁想?", + "笑了,谁关心你想不想的", + "你别想", + "别想了", + "太想了", + "搞得我也想了", + "噗,没忍住。", + "^^", + "逆天", + "你想你的,我得玩《绝区零》了。", + "差不多得了" ]; public static List SaySpecialNoWords { get; } = [