From 02949656bf17e95dadb73c51ad790e68f5117ed3 Mon Sep 17 00:00:00 2001
From: mctaylors <95250141+mctaylors@users.noreply.github.com>
Date: Fri, 12 May 2023 17:56:14 +0300
Subject: [PATCH] Change audit output if a message was deleted because of
'!clear' (#34)
---
Commands/ClearCommand.cs | 2 +-
Messages.Designer.cs | 9 +++++++++
Messages.resx | 3 +++
Messages.ru.resx | 3 +++
Messages.tt-ru.resx | 7 +++++--
5 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/Commands/ClearCommand.cs b/Commands/ClearCommand.cs
index 065c08a..4d10595 100644
--- a/Commands/ClearCommand.cs
+++ b/Commands/ClearCommand.cs
@@ -23,7 +23,7 @@ public sealed class ClearCommand : ICommand {
foreach (var msg in msgArray.Where(m => !m.Author.IsBot))
cmd.Audit(
string.Format(
- Messages.CachedMessageDeleted, msg.Author.Mention,
+ Messages.CachedMessageCleared, msg.Author.Mention,
Utils.MentionChannel(channel.Id),
Utils.Wrap(msg.CleanContent)), false);
}
diff --git a/Messages.Designer.cs b/Messages.Designer.cs
index 5e21849..54a7eab 100644
--- a/Messages.Designer.cs
+++ b/Messages.Designer.cs
@@ -1120,5 +1120,14 @@ namespace Boyfriend {
return ResourceManager.GetString("InvalidRemindIn", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to Deleted message using cleanup from {0} in channel {1}: {2}.
+ ///
+ internal static string CachedMessageCleared {
+ get {
+ return ResourceManager.GetString("CachedMessageCleared", resourceCulture);
+ }
+ }
}
}
diff --git a/Messages.resx b/Messages.resx
index 2db1a50..7e771ae 100644
--- a/Messages.resx
+++ b/Messages.resx
@@ -123,6 +123,9 @@
Deleted message from {0} in channel {1}: {2}
+
+ Cleared message from {0} in channel {1}: {2}
+
Edited message in channel {0}: {1} -> {2}
diff --git a/Messages.ru.resx b/Messages.ru.resx
index 72c10ff..cd5fecd 100644
--- a/Messages.ru.resx
+++ b/Messages.ru.resx
@@ -123,6 +123,9 @@
Удалено сообщение от {0} в канале {1}: {2}
+
+ Очищено сообщение от {0} в канале {1}: {2}
+
Отредактировано сообщение в канале {0}: {1} -> {2}
diff --git a/Messages.tt-ru.resx b/Messages.tt-ru.resx
index fa4af35..6f66300 100644
--- a/Messages.tt-ru.resx
+++ b/Messages.tt-ru.resx
@@ -121,10 +121,13 @@
{0}я родился!
- вырезано {0} в канале {1}: {2}
+ вырезано сообщение от {0} в канале {1}: {2}
+
+
+ вырезано сообщение (используя `!clear`) от {0} в канале {1}: {2}
- переделано {0}: {1} -> {2}
+ переделано сообщение от {0}: {1} -> {2}
{0}, добро пожаловать на сервер {1}