Reorganized files

MessageCache disabled. It will become part of a new feature.
This commit is contained in:
Noikoio 2017-11-06 18:15:52 -08:00
parent b67716ec94
commit 3780a34b0d
3 changed files with 5 additions and 3 deletions

View file

@ -7,11 +7,12 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Noikoio.RegexBot.Feature.DBCache namespace Noikoio.RegexBot.Feature.EntityCache
{ {
/// <summary> /// <summary>
/// Caches information regarding all known guilds, channels, and users. /// 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. /// 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.
/// </summary> /// </summary>
class EntityCache : BotFeature class EntityCache : BotFeature
{ {
@ -159,6 +160,8 @@ namespace Noikoio.RegexBot.Feature.DBCache
foreach (var item in users) foreach (var item in users)
{ {
if (item.IsBot || item.IsWebhook) continue;
uid.Value = item.Id; uid.Value = item.Id;
gid.Value = item.Guild.Id; gid.Value = item.Guild.Id;
uname.Value = item.Username; uname.Value = item.Username;

View file

@ -48,8 +48,7 @@ namespace Noikoio.RegexBot
new Feature.AutoMod.AutoMod(_client), new Feature.AutoMod.AutoMod(_client),
new Feature.ModTools.ModTools(_client), new Feature.ModTools.ModTools(_client),
new Feature.AutoRespond.AutoRespond(_client), new Feature.AutoRespond.AutoRespond(_client),
new Feature.DBCache.EntityCache(_client), // EntityCache goes before anything else that uses its data new Feature.EntityCache.EntityCache(_client) // EntityCache goes before anything else that uses its data
new Feature.DBCache.MessageCache(_client)
}; };
var dlog = Logger.GetLogger("Discord.Net"); var dlog = Logger.GetLogger("Discord.Net");
_client.Log += async (arg) => _client.Log += async (arg) =>