From 9a7bdeade5990d41045380fbdbb8a7259dbfb0bc Mon Sep 17 00:00:00 2001 From: LyMysterious Date: Sun, 5 Oct 2025 20:42:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=81=B5=E7=94=B0=E9=80=9A=E7=9F=A5=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=88=90=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XiaoXiaoRoBot/Cmd/LingTianCmd.cs | 27 +++++++++++++++++++++++++-- XiaoXiaoRoBot/appsettings.json | 4 +++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/XiaoXiaoRoBot/Cmd/LingTianCmd.cs b/XiaoXiaoRoBot/Cmd/LingTianCmd.cs index 7c7e603..0147553 100644 --- a/XiaoXiaoRoBot/Cmd/LingTianCmd.cs +++ b/XiaoXiaoRoBot/Cmd/LingTianCmd.cs @@ -1,5 +1,4 @@ -using System.Text.RegularExpressions; -using Lagrange.Core.Common.Interface.Api; +using Lagrange.Core.Common.Interface.Api; using Lagrange.Core.Message; using Lagrange.Core.Message.Entity; using RoBot.Core; @@ -7,7 +6,9 @@ using RoBot.Core.ConstValue; using RoBot.Core.Helper; using RoBot.Start.Global; using RoBot.Start.LogConfig; +using RoBot.Start.Message; using RoBot.Start.Service.Dto; +using System.Text.RegularExpressions; namespace RoBot.Start.Cmd { @@ -64,6 +65,13 @@ namespace RoBot.Start.Cmd var groupMessageChain = MessageBuilder.Group((uint)systemConfig.GroupQQ).Forward(chain).Text(msg); await bot.SendMessage(groupMessageChain.Build()); } + + MentionEntity callQQMember = chain.Where(o => o is MentionEntity).Cast().FirstOrDefault(); + if (callQQMember is not null) + { + uint qqNumber = callQQMember.Uin; + ScheduleNextNotify(qqNumber); + } } } } @@ -104,5 +112,20 @@ namespace RoBot.Start.Cmd } return await Task.FromResult(goodsInfos); } + + private static void ScheduleNextNotify(uint userId) + { + TimeSpan delay = TimeSpan.FromHours(47.01); + + Logs.Write($@"{DateTime.Now:yyyy-MM-dd HH:mm:ss} {userId} 触发下次灵田结算通知 "); + + _ = Task.Run(async () => + { + await Task.Delay(delay); + Dto.ConfigDto.ConfigSetting systemConfig = GlobalConfig.ConfigSetting; + Lagrange.Core.BotContext bot = GlobalConfig.BotContext; + await bot.SendMentionMsg((uint)systemConfig.GroupQQ, userId, $"\r\n【灵田结算通知】\r\n该结算奖励了!"); + }); + } } } diff --git a/XiaoXiaoRoBot/appsettings.json b/XiaoXiaoRoBot/appsettings.json index 7878a6c..f4faab6 100644 --- a/XiaoXiaoRoBot/appsettings.json +++ b/XiaoXiaoRoBot/appsettings.json @@ -124,6 +124,8 @@ "🍏♣🎋🐎": "青梅竹马", "🚬👦👂👀": "掩人耳目", "🌾💊😣👄": "良药苦口", - "🚴🐅😞👇": "骑虎难下" + "🚴🐅😞👇": "骑虎难下", + "❌👀😍🤔": "不堪设想", + "🍺🍀👨‍⚕️🥜": "九死一生" } } \ No newline at end of file