fix: 秘境结算修正
This commit is contained in:
@@ -19,7 +19,7 @@ namespace RoBot.Start.Cmd
|
||||
{
|
||||
MarkdownEntity miJingEntity = chain.Where(o => o is MarkdownEntity)
|
||||
.Cast<MarkdownEntity>()
|
||||
.Where(o => o.Data.Content.Contains("进入秘境"))
|
||||
.Where(o => o.Data.Content.Contains("进入秘境:") || o.Data.Content.Contains("道友已踏入:"))
|
||||
.FirstOrDefault();
|
||||
if (miJingEntity is not null)
|
||||
{
|
||||
@@ -43,11 +43,13 @@ namespace RoBot.Start.Cmd
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
|
||||
private static void ScheduleReminder(uint userId, int minutes)
|
||||
private static void ScheduleReminder(uint userId, double minutes)
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
TimeSpan delay = TimeSpan.FromMinutes(minutes);
|
||||
|
||||
Logs.Write($@"{DateTime.Now:yyyy-MM-dd HH:mm:ss} {userId} 秘境通知 {minutes}分钟");
|
||||
Logs.Write($@"{now:yyyy-MM-dd HH:mm:ss} {userId} 触发秘境通知 {minutes}分钟 结束时间: {now.AddMinutes(minutes):yyyy-MM-dd HH:mm:ss}");
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
@@ -58,7 +60,7 @@ namespace RoBot.Start.Cmd
|
||||
});
|
||||
}
|
||||
|
||||
private static int ParseMinutes(string content)
|
||||
private static double ParseMinutes(string content)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(content)) return 0;
|
||||
|
||||
@@ -72,7 +74,7 @@ namespace RoBot.Start.Cmd
|
||||
{
|
||||
if (double.TryParse(match.Groups[2].Value, NumberStyles.Float, CultureInfo.InvariantCulture, out double val))
|
||||
{
|
||||
return (int)Math.Ceiling(val);
|
||||
return (double)val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user