From 1b6a204f3219f1774996eec23108adfb6d8ef617 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sun, 20 Mar 2022 17:59:44 +0000 Subject: [PATCH] Use correct resource file for log messages --- Hammer/Resources/LoggerMessages.Designer.cs | 18 ++++++++++++++++++ Hammer/Resources/LoggerMessages.resx | 6 ++++++ Hammer/Services/MessageReportService.cs | 4 ++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Hammer/Resources/LoggerMessages.Designer.cs b/Hammer/Resources/LoggerMessages.Designer.cs index cfbb40d..f70d001 100644 --- a/Hammer/Resources/LoggerMessages.Designer.cs +++ b/Hammer/Resources/LoggerMessages.Designer.cs @@ -78,6 +78,15 @@ internal static string CantUnmuteNonMember { } } + /// + /// Looks up a localized string similar to {user} attempted to create a duplicate report on {message} by {message.Author} in {message.Channel} - this report will not be logged in Discord.. + /// + internal static string DuplicateMessageReport { + get { + return ResourceManager.GetString("DuplicateMessageReport", resourceCulture); + } + } + /// /// Looks up a localized string similar to {user} was muted by {staffMember} in {guild}. /// @@ -105,6 +114,15 @@ internal static string MessageReportBlocked { } } + /// + /// Looks up a localized string similar to {user} reported {message} by {message.Author} in {message.Channel}. + /// + internal static string MessageReported { + get { + return ResourceManager.GetString("MessageReported", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unable to grant role! Muted role not found for {guild}. /// diff --git a/Hammer/Resources/LoggerMessages.resx b/Hammer/Resources/LoggerMessages.resx index c8b3522..4c997f0 100644 --- a/Hammer/Resources/LoggerMessages.resx +++ b/Hammer/Resources/LoggerMessages.resx @@ -29,6 +29,9 @@ {user} is not in {guild} - the Muted role will not be reapplied if they rejoin the server. + + {user} attempted to create a duplicate report on {message} by {message.Author} in {message.Channel} - this report will not be logged in Discord. + Unable to grant role! Muted role not found for {guild} @@ -44,6 +47,9 @@ {user} reported a message, but is blocked from doing so + + {user} reported {message} by {message.Author} in {message.Channel} + {staffMember} sent a message to {recipient} from {guild}. Contents: {message} diff --git a/Hammer/Services/MessageReportService.cs b/Hammer/Services/MessageReportService.cs index 1440aea..eb9fcf4 100644 --- a/Hammer/Services/MessageReportService.cs +++ b/Hammer/Services/MessageReportService.cs @@ -143,11 +143,11 @@ public async Task ReportMessageAsync(DiscordMessage message, DiscordMember repor bool duplicateReport = HasUserReportedMessage(message, reporter); if (duplicateReport) { - Logger.Info(LogMessages.DuplicateMessageReport.FormatSmart(new {user = reporter, message})); + Logger.Info(LoggerMessages.DuplicateMessageReport.FormatSmart(new {user = reporter, message})); return; } - Logger.Info(LogMessages.MessageReported.FormatSmart(new {user = reporter, message})); + Logger.Info(LoggerMessages.MessageReported.FormatSmart(new {user = reporter, message})); await CreateNewMessageReportAsync(message, reporter); await reporter.SendMessageAsync(CreateUserReportEmbed(message, reporter)); await _corePlugin.LogAsync(reporter.Guild, CreateStaffReportEmbed(message, reporter), StaffNotificationOptions.Here);