diff --git a/Module/ModLogs/MessageCache.cs b/Module/ModLogs/MessageCache.cs
index 80cd933..7c67a27 100644
--- a/Module/ModLogs/MessageCache.cs
+++ b/Module/ModLogs/MessageCache.cs
@@ -1,64 +1,63 @@
using Discord.WebSocket;
-using Newtonsoft.Json.Linq;
-using Noikoio.RegexBot.ConfigItem;
using Npgsql;
using NpgsqlTypes;
+using System;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Module.DBCache
+namespace Noikoio.RegexBot.Module.ModLogs
{
///
- /// Caches information regarding all incoming messages.
- /// The function of this feature should be transparent to the user, and thus no configuration is needed.
+ /// Helper class for . Keeps a database-backed cache of recent messages and assists
+ /// in reporting message changes and deletions, if configured to do so.
+ /// Does not manipulate the moderation log managed by the main class, but rather provides supplemental features.
///
- class MessageCache : BotFeature
+ class MessageCache
{
- // TODO Something that clears expired cache items
- private readonly DatabaseConfig _db;
+ private readonly DiscordSocketClient _dClient;
+ private readonly AsyncLogger _outLog;
+ private readonly Func _outGetConfig;
- public override string Name => nameof(MessageCache);
-
- public MessageCache(DiscordSocketClient client) : base(client)
+ public MessageCache(DiscordSocketClient client, AsyncLogger logger, Func getConfFunc)
{
- _db = RegexBot.Config.Database;
+ _dClient = client;
+ _outLog = logger;
+ _outGetConfig = getConfFunc;
- if (_db.Enabled)
- {
- CreateCacheTables();
+ CreateCacheTables();
- client.MessageReceived += Client_MessageReceived;
- //client.MessageUpdated += Client_MessageUpdated;
- }
- else
- {
- Log("No database storage available.").Wait();
- }
+ client.MessageReceived += Client_MessageReceived;
+ client.MessageUpdated += Client_MessageUpdated;
+ client.MessageDeleted += Client_MessageDeleted;
}
- #region Table setup
- const string TableMessage = "cache_messages";
-
- public override Task