feat: 灵田通知 新增成语
This commit is contained in:
@@ -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<MentionEntity>().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该结算奖励了!");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +124,8 @@
|
||||
"🍏♣🎋🐎": "青梅竹马",
|
||||
"🚬👦👂👀": "掩人耳目",
|
||||
"🌾💊😣👄": "良药苦口",
|
||||
"🚴🐅😞👇": "骑虎难下"
|
||||
"🚴🐅😞👇": "骑虎难下",
|
||||
"❌👀😍🤔": "不堪设想",
|
||||
"🍺🍀👨⚕️🥜": "九死一生"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user