Skip to content

Commit

Permalink
Use correct resource file for log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Mar 20, 2022
1 parent fb224f0 commit 1b6a204
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
18 changes: 18 additions & 0 deletions Hammer/Resources/LoggerMessages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Hammer/Resources/LoggerMessages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<data name="CantUnmuteNonMember" xml:space="preserve">
<value>{user} is not in {guild} - the Muted role will not be reapplied if they rejoin the server.</value>
</data>
<data name="DuplicateMessageReport" xml:space="preserve">
<value>{user} attempted to create a duplicate report on {message} by {message.Author} in {message.Channel} - this report will not be logged in Discord.</value>
</data>
<data name="NoMutedRoleToGrant" xml:space="preserve">
<value>Unable to grant role! Muted role not found for {guild}</value>
</data>
Expand All @@ -44,6 +47,9 @@
<data name="MessageReportBlocked" xml:space="preserve">
<value>{user} reported a message, but is blocked from doing so</value>
</data>
<data name="MessageReported" xml:space="preserve">
<value>{user} reported {message} by {message.Author} in {message.Channel}</value>
</data>
<data name="StaffMessagedMember" xml:space="preserve">
<value>{staffMember} sent a message to {recipient} from {guild}. Contents: {message}</value>
</data>
Expand Down
4 changes: 2 additions & 2 deletions Hammer/Services/MessageReportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1b6a204

Please sign in to comment.