From 3780a34b0dd599854aaf58bd8298873a1087db5e Mon Sep 17 00:00:00 2001 From: Noikoio Date: Mon, 6 Nov 2017 18:15:52 -0800 Subject: [PATCH] Reorganized files MessageCache disabled. It will become part of a new feature. --- Feature/{DBCache => EntityCache}/EntityCache.cs | 5 ++++- Feature/{DBCache => ModLogs}/MessageCache.cs | 0 RegexBot.cs | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) rename Feature/{DBCache => EntityCache}/EntityCache.cs (97%) rename Feature/{DBCache => ModLogs}/MessageCache.cs (100%) diff --git a/Feature/DBCache/EntityCache.cs b/Feature/EntityCache/EntityCache.cs similarity index 97% rename from Feature/DBCache/EntityCache.cs rename to Feature/EntityCache/EntityCache.cs index 26b221f..467e2ca 100644 --- a/Feature/DBCache/EntityCache.cs +++ b/Feature/EntityCache/EntityCache.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -namespace Noikoio.RegexBot.Feature.DBCache +namespace Noikoio.RegexBot.Feature.EntityCache { /// /// Caches information regarding all known guilds, channels, and users. /// The function of this feature should be transparent to the user, and thus no configuration is needed. + /// This feature should be initialized BEFORE any other features that make use of guild and user cache. /// class EntityCache : BotFeature { @@ -159,6 +160,8 @@ namespace Noikoio.RegexBot.Feature.DBCache foreach (var item in users) { + if (item.IsBot || item.IsWebhook) continue; + uid.Value = item.Id; gid.Value = item.Guild.Id; uname.Value = item.Username; diff --git a/Feature/DBCache/MessageCache.cs b/Feature/ModLogs/MessageCache.cs similarity index 100% rename from Feature/DBCache/MessageCache.cs rename to Feature/ModLogs/MessageCache.cs diff --git a/RegexBot.cs b/RegexBot.cs index 5f36039..12719b9 100644 --- a/RegexBot.cs +++ b/RegexBot.cs @@ -48,8 +48,7 @@ namespace Noikoio.RegexBot new Feature.AutoMod.AutoMod(_client), new Feature.ModTools.ModTools(_client), new Feature.AutoRespond.AutoRespond(_client), - new Feature.DBCache.EntityCache(_client), // EntityCache goes before anything else that uses its data - new Feature.DBCache.MessageCache(_client) + new Feature.EntityCache.EntityCache(_client) // EntityCache goes before anything else that uses its data }; var dlog = Logger.GetLogger("Discord.Net"); _client.Log += async (arg) =>