From 08dd21234785633e6a81063ad1e1366e9ebd81dc Mon Sep 17 00:00:00 2001 From: 13xforever Date: Sat, 26 Jul 2025 19:35:07 +0500 Subject: [PATCH 1/3] update min macos version --- .../LogParserResultFormatter.GeneralNotesSection.cs | 6 +++--- .../Utils/ResultFormatters/LogParserResultFormatter.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs index 95e745b6..5e7cac45 100644 --- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs +++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.GeneralNotesSection.cs @@ -273,13 +273,13 @@ internal static partial class LogParserResult if (items["os_type"] is "Windows" && Version.TryParse(items["os_version"], out var winVersion) - && (winVersion is { Major: < 10 } or { Build: < 19045 or (> 20000 and < 22621) })) + && (winVersion is { Major: < 10 } or { Build: <19045 or (>20000 and <22621) })) notes.Add("⚠️ Please [upgrade your Windows](https://www.microsoft.com/en-us/software-download/windows11) to currently supported version"); if (items["os_type"] is "MacOS" && Version.TryParse(items["os_version"], out var macVersion)) { - if (macVersion is {Major: < 12}) + if (macVersion is {Major: <14}) notes.Add("⚠️ Please [upgrade your macOS](https://support.apple.com/en-us/109033#latest) to currently supported version"); - else if (macVersion is { Major: 14, Minor: >= 0 and <= 2 }) + else if (macVersion is { Major: 14, Minor: >=0 and <=2 }) notes.Add("❌️ Please update your OS to version 14.3 or newer"); } diff --git a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs index 880269c4..c33fa38a 100644 --- a/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs +++ b/CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs @@ -1075,7 +1075,7 @@ internal static partial class LogParserResult return $"{osType} {kernelVersion}"; } - private static string? GetMacOsVersion(Version macVer) + private static string GetMacOsVersion(Version macVer) => macVer.Major switch { 10 => macVer.Minor switch From 0e649956ea9db3285252b61ddd5c2cf5d81385b4 Mon Sep 17 00:00:00 2001 From: 13xforever Date: Sat, 26 Jul 2025 19:52:46 +0500 Subject: [PATCH 2/3] fix another cpu tier misdetection --- CompatBot/Ocr/OcrProvider.cs | 1 + SourceGenerators/CpuTierListGenerator.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CompatBot/Ocr/OcrProvider.cs b/CompatBot/Ocr/OcrProvider.cs index a0f9052f..f2e36b2b 100644 --- a/CompatBot/Ocr/OcrProvider.cs +++ b/CompatBot/Ocr/OcrProvider.cs @@ -26,6 +26,7 @@ public static class OcrProvider backendName = "tesseract"; result = GetBackend(backendName)!; } + Config.Log.Info($"Initializing OCR backend {BackendName}…"); if (await result.InitializeAsync(cancellationToken).ConfigureAwait(false)) { backend = result; diff --git a/SourceGenerators/CpuTierListGenerator.cs b/SourceGenerators/CpuTierListGenerator.cs index 5e9005cd..0b6a1319 100644 --- a/SourceGenerators/CpuTierListGenerator.cs +++ b/SourceGenerators/CpuTierListGenerator.cs @@ -75,11 +75,11 @@ public class CpuTierListGenerator: IIncrementalGenerator ); */ result.AppendLine($""" - private static readonly Regex Model{idx++} = new(@"{line}", DefaultOptions); + private static readonly Regex Model{idx++} = new(@"\b{line}", DefaultOptions); """ ); } - result.AppendLine($""" + result.AppendLine(""" public static readonly List<(string model, string tier, Regex regex)> List = [ """ From 51d8cb761d1c04aecc5a24d9e2524c0f3b9ef18c Mon Sep 17 00:00:00 2001 From: 13xforever Date: Sat, 26 Jul 2025 20:23:13 +0500 Subject: [PATCH 3/3] remove special case for bot DMs and bot-spam channel for log parsing --- CompatBot/EventHandlers/LogParsingHandler.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/CompatBot/EventHandlers/LogParsingHandler.cs b/CompatBot/EventHandlers/LogParsingHandler.cs index 0747fce6..a24bfc7c 100644 --- a/CompatBot/EventHandlers/LogParsingHandler.cs +++ b/CompatBot/EventHandlers/LogParsingHandler.cs @@ -176,11 +176,9 @@ public static class LogParsingHandler if (await message.Author.IsWhitelistedAsync(client, channel.Guild).ConfigureAwait(false)) { var piracyWarning = await result.AsEmbedAsync(client, message, source).ConfigureAwait(false); - piracyWarning = piracyWarning.WithDescription( - "Please remove the log and issue warning to the original author of the log"); + piracyWarning = piracyWarning.WithDescription("Please remove the log and issue warning to the original author of the log"); botMsg = await botMsg.UpdateOrCreateMessageAsync(channel, embed: piracyWarning).ConfigureAwait(false); - var matchedOn = ContentFilter.GetMatchedScope(result.SelectedFilter, - result.SelectedFilterContext); + var matchedOn = ContentFilter.GetMatchedScope(result.SelectedFilter, result.SelectedFilterContext); await client.ReportAsync(yarr + " Pirated Release (whitelisted by role)", message, result.SelectedFilter.String, matchedOn, result.SelectedFilter.Id, result.SelectedFilterContext, ReportSeverity.Low).ConfigureAwait(false); @@ -190,8 +188,7 @@ public static class LogParsingHandler var severity = ReportSeverity.Low; try { - DeletedMessagesMonitor.RemovedByBotCache.Set(message.Id, true, - DeletedMessagesMonitor.CacheRetainTime); + DeletedMessagesMonitor.RemovedByBotCache.Set(message.Id, true, DeletedMessagesMonitor.CacheRetainTime); await message.DeleteAsync("Piracy detected in log").ConfigureAwait(false); } catch (Exception e) @@ -218,8 +215,7 @@ public static class LogParsingHandler } try { - var matchedOn = ContentFilter.GetMatchedScope(result.SelectedFilter, - result.SelectedFilterContext); + var matchedOn = ContentFilter.GetMatchedScope(result.SelectedFilter, result.SelectedFilterContext); await client.ReportAsync(yarr + " Pirated Release", message, result.SelectedFilter.String, matchedOn, result.SelectedFilter.Id, result.SelectedFilterContext, severity).ConfigureAwait(false); @@ -228,7 +224,7 @@ public static class LogParsingHandler { Config.Log.Error(e, "Failed to send piracy report"); } - if (!(message.Channel!.IsPrivate || message.Channel.Name.Contains("spam"))) + //if (!(message.Channel!.IsPrivate || message.Channel.Name.Contains("spam"))) { var reason = "Logs showing use of pirated content"; var (saved, suppress, recent, total) = await Warnings.AddAsync( @@ -246,7 +242,7 @@ public static class LogParsingHandler Warned for: {reason} by {client.CurrentUser.Mention} """ ).AddMention(new UserMention(message.Author)); - await message.Channel.SendMessageAsync(msg).ConfigureAwait(false); + await message.Channel!.SendMessageAsync(msg).ConfigureAwait(false); } } }