feat: 新增灵田 秘境结算持久化
This commit is contained in:
+8
-32
@@ -1,5 +1,4 @@
|
||||
using Furion.Logging;
|
||||
using NapCatRobotClient.Core.RobotAPI.Dto.Request;
|
||||
using System.Globalization;
|
||||
|
||||
namespace NapCatRobotClient.Service.Group.TextProcess
|
||||
@@ -51,40 +50,17 @@ namespace NapCatRobotClient.Service.Group.TextProcess
|
||||
|
||||
private static void ScheduleReminder(string groupId, string userId, double minutes)
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
DateTime now = DateTime.Now.AddMinutes(minutes);
|
||||
|
||||
TimeSpan delay = TimeSpan.FromMinutes(minutes);
|
||||
Log.Information($@"{now:yyyy-MM-dd HH:mm:ss} {userId} 触发秘境通知 {minutes}分钟 结束时间: {now:yyyy-MM-dd HH:mm:ss}");
|
||||
|
||||
Log.Information($@"{now:yyyy-MM-dd HH:mm:ss} {userId} 触发秘境通知 {minutes}分钟 结束时间: {now.AddMinutes(minutes):yyyy-MM-dd HH:mm:ss}");
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
RedisHelper.Client.Set($"{RedisPrefix.MiJingKey}{groupId}:{userId}", new TaskDetailInfo()
|
||||
{
|
||||
await Task.Delay(delay);
|
||||
GroupSendMessageRequest request = new()
|
||||
{
|
||||
GroupId = groupId,
|
||||
Message = new()
|
||||
{
|
||||
new MessageItem()
|
||||
{
|
||||
Type = "text",
|
||||
Data = new()
|
||||
{
|
||||
Text = $"【秘境结算通知】\r\n探索已完成,该结算奖励了!({minutes} 分钟)"
|
||||
}
|
||||
},
|
||||
new MessageItem()
|
||||
{
|
||||
Type = "at",
|
||||
Data = new()
|
||||
{
|
||||
QQ = userId
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
await RobotAPI.SendGroupText(request);
|
||||
});
|
||||
GroupId = groupId,
|
||||
Minutes = minutes,
|
||||
UserId = userId,
|
||||
TriggerTime = now
|
||||
}, Convert.ToInt32((minutes + 3) * 60));
|
||||
}
|
||||
|
||||
private static double ParseMinutes(string content)
|
||||
|
||||
Reference in New Issue
Block a user