diff --git a/BetterGenshinImpact/Core/Script/Dependence/Notification.cs b/BetterGenshinImpact/Core/Script/Dependence/Notification.cs new file mode 100644 index 00000000..2274476f --- /dev/null +++ b/BetterGenshinImpact/Core/Script/Dependence/Notification.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using BetterGenshinImpact.Core.Config; +using BetterGenshinImpact.GameTask; +using BetterGenshinImpact.Service.Notification; +using BetterGenshinImpact.Service.Notification.Model.Enum; +using Microsoft.Extensions.Logging; + +namespace BetterGenshinImpact.Core.Script.Dependence; + +public class Notification +{ + private readonly AllConfig _config = TaskContext.Instance().Config; + private readonly ILogger _logger = App.GetLogger(); + private readonly TimeSpan _timeWindow = TimeSpan.FromMinutes(1); + private readonly int _maxNotifications = 5; + private readonly Queue _callRecords = new(); + + private static readonly string[] _forbiddenPatterns = + [ + "