diff --git a/BotFeature.cs b/BotModule.cs
similarity index 79%
rename from BotFeature.cs
rename to BotModule.cs
index ca43b8f..959b6e3 100644
--- a/BotFeature.cs
+++ b/BotModule.cs
@@ -7,12 +7,9 @@ using System.Threading.Tasks;
namespace Noikoio.RegexBot
{
///
- /// Base class for bot features
+ /// Base class for bot modules
///
- ///
- /// This may have use in some sort of external plugin system later.
- ///
- abstract class BotFeature
+ abstract class BotModule
{
private readonly DiscordSocketClient _client;
private readonly AsyncLogger _logger;
@@ -20,20 +17,20 @@ namespace Noikoio.RegexBot
public abstract string Name { get; }
protected DiscordSocketClient Client => _client;
- public BotFeature(DiscordSocketClient client)
+ public BotModule(DiscordSocketClient client)
{
_client = client;
_logger = Logger.GetLogger(this.Name);
}
///
- /// Processes feature-specific configuration.
+ /// Processes module-specific configuration.
///
///
- /// Feature code should not hold on to this data, but instead use to retrieve
+ /// Module code should not hold on to this data, but instead use to retrieve
/// them. This is in the event that configuration is reverted to an earlier state and allows for the
- /// bot and all features to revert to previously used configuration values with no effort on the part
- /// of individual features.
+ /// all modules to revert to previously used configuration values with no effort on the part of the
+ /// module code itself.
///
///
/// Processed configuration data prepared for later use.
@@ -45,7 +42,7 @@ namespace Noikoio.RegexBot
public abstract Task ProcessConfiguration(JToken configSection);
///
- /// Gets this feature's relevant configuration data associated with the given Discord guild.
+ /// Gets this module's relevant configuration data associated with the given Discord guild.
///
///
/// The stored configuration data, or null if none exists.
@@ -58,7 +55,7 @@ namespace Noikoio.RegexBot
throw new ArgumentException("There is no known configuration associated with the given Guild ID.");
}
- if (sc.FeatureConfigs.TryGetValue(this, out var item)) return item;
+ if (sc.ModuleConfigs.TryGetValue(this, out var item)) return item;
else return null;
}
@@ -88,7 +85,7 @@ namespace Noikoio.RegexBot
///
/// Indicates which section under an individual Discord guild configuration should be passed to the
- /// feature's method during configuration load.
+ /// module's method during configuration load.
///
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
public class ConfigSectionAttribute : Attribute
diff --git a/ConfigItem/DatabaseConfig.cs b/ConfigItem/DatabaseConfig.cs
index 71a06ed..3cee6e3 100644
--- a/ConfigItem/DatabaseConfig.cs
+++ b/ConfigItem/DatabaseConfig.cs
@@ -14,9 +14,9 @@ namespace Noikoio.RegexBot.ConfigItem
private readonly string _parsemsg;
///
- /// Gets whether database features are enabled.
+ /// Gets whether database storage is available.
///
- public bool Enabled => _enabled;
+ public bool Available => _enabled;
///
/// Constructor error message (only if not enabled)
///
@@ -49,7 +49,7 @@ namespace Noikoio.RegexBot.ConfigItem
public async Task GetOpenConnectionAsync()
{
- if (!Enabled) return null;
+ if (!Available) return null;
var cs = new NpgsqlConnectionStringBuilder()
{
diff --git a/ConfigItem/ServerConfig.cs b/ConfigItem/ServerConfig.cs
index 88fe65f..f507840 100644
--- a/ConfigItem/ServerConfig.cs
+++ b/ConfigItem/ServerConfig.cs
@@ -10,18 +10,18 @@ namespace Noikoio.RegexBot.ConfigItem
{
private readonly ulong _id;
private EntityList _moderators;
- private ReadOnlyDictionary _featureData;
+ private ReadOnlyDictionary _modData;
public ulong? Id => _id;
public EntityList Moderators => _moderators;
- public ReadOnlyDictionary FeatureConfigs => _featureData;
+ public ReadOnlyDictionary ModuleConfigs => _modData;
- public ServerConfig(ulong id, EntityList moderators, ReadOnlyDictionary featureconf)
+ public ServerConfig(ulong id, EntityList moderators, ReadOnlyDictionary modconf)
{
_id = id;
_moderators = moderators;
- _featureData = featureconf;
- Debug.Assert(_moderators != null && _featureData != null);
+ _modData = modconf;
+ Debug.Assert(_moderators != null && _modData != null);
}
}
}
diff --git a/Configuration.cs b/Configuration.cs
index ac799f0..e49a760 100644
--- a/Configuration.cs
+++ b/Configuration.cs
@@ -137,9 +137,9 @@ namespace Noikoio.RegexBot
EntityList mods = new EntityList(sconf["moderators"]);
if (sconf["moderators"] != null) await SLog("Moderator " + mods.ToString());
- // Load feature configurations
- Dictionary customConfs = new Dictionary();
- foreach (var item in _bot.Features)
+ // Load module configurations
+ Dictionary customConfs = new Dictionary();
+ foreach (var item in _bot.Modules)
{
var attr = item.GetType().GetTypeInfo()
.GetMethod("ProcessConfiguration").GetCustomAttribute();
@@ -173,7 +173,7 @@ namespace Noikoio.RegexBot
// Switch to using new data
List> rulesfinal = new List>();
- newservers.Add(new ServerConfig(sid, mods, new ReadOnlyDictionary(customConfs)));
+ newservers.Add(new ServerConfig(sid, mods, new ReadOnlyDictionary(customConfs)));
}
_servers = newservers.ToArray();
diff --git a/Feature/AutoMod/AutoMod.cs b/Module/AutoMod/AutoMod.cs
similarity index 97%
rename from Feature/AutoMod/AutoMod.cs
rename to Module/AutoMod/AutoMod.cs
index 733cca4..b6158cb 100644
--- a/Feature/AutoMod/AutoMod.cs
+++ b/Module/AutoMod/AutoMod.cs
@@ -4,7 +4,7 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod
+namespace Noikoio.RegexBot.Module.AutoMod
{
///
/// Implements per-message regex matching and executes customizable responses.
@@ -14,7 +14,7 @@ namespace Noikoio.RegexBot.Feature.AutoMod
/// Strictly for use as a moderation tool only. Triggers that simply reply to messages
/// should be implemented using .
///
- class AutoMod : BotFeature
+ class AutoMod : BotModule
{
public override string Name => "AutoMod";
diff --git a/Feature/AutoMod/ConfigItem.cs b/Module/AutoMod/ConfigItem.cs
similarity index 99%
rename from Feature/AutoMod/ConfigItem.cs
rename to Module/AutoMod/ConfigItem.cs
index 776dc24..f8795a3 100644
--- a/Feature/AutoMod/ConfigItem.cs
+++ b/Module/AutoMod/ConfigItem.cs
@@ -8,7 +8,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod
+namespace Noikoio.RegexBot.Module.AutoMod
{
///
/// Representation of a single AutoMod rule.
diff --git a/Feature/AutoMod/ResponseBase.cs b/Module/AutoMod/ResponseBase.cs
similarity index 99%
rename from Feature/AutoMod/ResponseBase.cs
rename to Module/AutoMod/ResponseBase.cs
index 67a9f20..5cbbb87 100644
--- a/Feature/AutoMod/ResponseBase.cs
+++ b/Module/AutoMod/ResponseBase.cs
@@ -7,7 +7,7 @@ using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod
+namespace Noikoio.RegexBot.Module.AutoMod
{
///
/// Base class for all Response classes.
diff --git a/Feature/AutoMod/Responses/Ban.cs b/Module/AutoMod/Responses/Ban.cs
similarity index 96%
rename from Feature/AutoMod/Responses/Ban.cs
rename to Module/AutoMod/Responses/Ban.cs
index de3324c..f3650d2 100644
--- a/Feature/AutoMod/Responses/Ban.cs
+++ b/Module/AutoMod/Responses/Ban.cs
@@ -3,7 +3,7 @@ using Noikoio.RegexBot.ConfigItem;
using System;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod.Responses
+namespace Noikoio.RegexBot.Module.AutoMod.Responses
{
///
/// Bans the invoking user.
diff --git a/Feature/AutoMod/Responses/Kick.cs b/Module/AutoMod/Responses/Kick.cs
similarity index 94%
rename from Feature/AutoMod/Responses/Kick.cs
rename to Module/AutoMod/Responses/Kick.cs
index de4c3e5..b9fe9f7 100644
--- a/Feature/AutoMod/Responses/Kick.cs
+++ b/Module/AutoMod/Responses/Kick.cs
@@ -3,7 +3,7 @@ using Noikoio.RegexBot.ConfigItem;
using System;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod.Responses
+namespace Noikoio.RegexBot.Module.AutoMod.Responses
{
///
/// Kicks the invoking user.
diff --git a/Feature/AutoMod/Responses/Remove.cs b/Module/AutoMod/Responses/Remove.cs
similarity index 92%
rename from Feature/AutoMod/Responses/Remove.cs
rename to Module/AutoMod/Responses/Remove.cs
index bc9af6a..0ba0809 100644
--- a/Feature/AutoMod/Responses/Remove.cs
+++ b/Module/AutoMod/Responses/Remove.cs
@@ -3,7 +3,7 @@ using Noikoio.RegexBot.ConfigItem;
using System;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod.Responses
+namespace Noikoio.RegexBot.Module.AutoMod.Responses
{
///
/// Removes the invoking message.
diff --git a/Feature/AutoMod/Responses/Report.cs b/Module/AutoMod/Responses/Report.cs
similarity index 98%
rename from Feature/AutoMod/Responses/Report.cs
rename to Module/AutoMod/Responses/Report.cs
index c858899..af5e92f 100644
--- a/Feature/AutoMod/Responses/Report.cs
+++ b/Module/AutoMod/Responses/Report.cs
@@ -5,7 +5,7 @@ using System;
using System.Text;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod.Responses
+namespace Noikoio.RegexBot.Module.AutoMod.Responses
{
///
/// Sends a summary of the invoking message, along with information
diff --git a/Feature/AutoMod/Responses/RoleManipulation.cs b/Module/AutoMod/Responses/RoleManipulation.cs
similarity index 98%
rename from Feature/AutoMod/Responses/RoleManipulation.cs
rename to Module/AutoMod/Responses/RoleManipulation.cs
index 75dab33..3bd223b 100644
--- a/Feature/AutoMod/Responses/RoleManipulation.cs
+++ b/Module/AutoMod/Responses/RoleManipulation.cs
@@ -4,7 +4,7 @@ using System;
using System.Linq;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod.Responses
+namespace Noikoio.RegexBot.Module.AutoMod.Responses
{
///
/// Manipulates a given user's role.
diff --git a/Feature/AutoMod/Responses/Say.cs b/Module/AutoMod/Responses/Say.cs
similarity index 96%
rename from Feature/AutoMod/Responses/Say.cs
rename to Module/AutoMod/Responses/Say.cs
index b793e5e..d68be90 100644
--- a/Feature/AutoMod/Responses/Say.cs
+++ b/Module/AutoMod/Responses/Say.cs
@@ -3,7 +3,7 @@ using Noikoio.RegexBot.ConfigItem;
using System;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoMod.Responses
+namespace Noikoio.RegexBot.Module.AutoMod.Responses
{
///
/// Sends a message to the given target.
diff --git a/Feature/AutoRespond/AutoRespond.cs b/Module/AutoRespond/AutoRespond.cs
similarity index 96%
rename from Feature/AutoRespond/AutoRespond.cs
rename to Module/AutoRespond/AutoRespond.cs
index f5afc65..ca15c31 100644
--- a/Feature/AutoRespond/AutoRespond.cs
+++ b/Module/AutoRespond/AutoRespond.cs
@@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.AutoRespond
+namespace Noikoio.RegexBot.Module.AutoRespond
{
///
/// Similar to , but lightweight.
@@ -19,9 +19,9 @@ namespace Noikoio.RegexBot.Feature.AutoRespond
///
///
///
- partial class AutoRespond : BotFeature
+ partial class AutoRespond : BotModule
{
- #region BotFeature implementation
+ #region BotModule implementation
public override string Name => "AutoRespond";
public AutoRespond(DiscordSocketClient client) : base(client)
diff --git a/Feature/AutoRespond/ConfigItem.cs b/Module/AutoRespond/ConfigItem.cs
similarity index 99%
rename from Feature/AutoRespond/ConfigItem.cs
rename to Module/AutoRespond/ConfigItem.cs
index 06ebc47..7ed89a1 100644
--- a/Feature/AutoRespond/ConfigItem.cs
+++ b/Module/AutoRespond/ConfigItem.cs
@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
-namespace Noikoio.RegexBot.Feature.AutoRespond
+namespace Noikoio.RegexBot.Module.AutoRespond
{
///
/// Represents a single autoresponse definition.
diff --git a/Feature/AutoRespond/RateLimitCache.cs b/Module/AutoRespond/RateLimitCache.cs
similarity index 97%
rename from Feature/AutoRespond/RateLimitCache.cs
rename to Module/AutoRespond/RateLimitCache.cs
index 20e92a7..f84bfa2 100644
--- a/Feature/AutoRespond/RateLimitCache.cs
+++ b/Module/AutoRespond/RateLimitCache.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
-namespace Noikoio.RegexBot.Feature.AutoRespond
+namespace Noikoio.RegexBot.Module.AutoRespond
{
///
/// Stores rate limit settings and caches.
diff --git a/Feature/EntityCache/EntityCache.cs b/Module/EntityCache/EntityCache.cs
similarity index 94%
rename from Feature/EntityCache/EntityCache.cs
rename to Module/EntityCache/EntityCache.cs
index 259c1ce..8af68ec 100644
--- a/Feature/EntityCache/EntityCache.cs
+++ b/Module/EntityCache/EntityCache.cs
@@ -7,14 +7,14 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.EntityCache
+namespace Noikoio.RegexBot.Module.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.
+ /// The function of this module should be transparent to the user, and thus no configuration is needed.
+ /// This module should be initialized BEFORE any other modules that make use of guild and user cache.
///
- class EntityCache : BotFeature
+ class EntityCache : BotModule
{
private readonly DatabaseConfig _db;
@@ -24,7 +24,7 @@ namespace Noikoio.RegexBot.Feature.EntityCache
{
_db = RegexBot.Config.Database;
- if (_db.Enabled)
+ if (_db.Available)
{
Sql.CreateCacheTables();
diff --git a/Feature/EntityCache/Sql.cs b/Module/EntityCache/Sql.cs
similarity index 97%
rename from Feature/EntityCache/Sql.cs
rename to Module/EntityCache/Sql.cs
index 0cf3f81..ed55b0b 100644
--- a/Feature/EntityCache/Sql.cs
+++ b/Module/EntityCache/Sql.cs
@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Text;
-namespace Noikoio.RegexBot.Feature.EntityCache
+namespace Noikoio.RegexBot.Module.EntityCache
{
///
/// Contains common constants and static methods for cache access.
diff --git a/Feature/EntityCache/UserCacheItem.cs b/Module/EntityCache/UserCacheItem.cs
similarity index 99%
rename from Feature/EntityCache/UserCacheItem.cs
rename to Module/EntityCache/UserCacheItem.cs
index 9b09f99..d82ace5 100644
--- a/Feature/EntityCache/UserCacheItem.cs
+++ b/Module/EntityCache/UserCacheItem.cs
@@ -4,7 +4,7 @@ using System.Data.Common;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.EntityCache
+namespace Noikoio.RegexBot.Module.EntityCache
{
///
/// Represents a cached user.
diff --git a/Feature/ModTools/CommandBase.cs b/Module/ModTools/CommandBase.cs
similarity index 98%
rename from Feature/ModTools/CommandBase.cs
rename to Module/ModTools/CommandBase.cs
index 2f8e720..d63cdc1 100644
--- a/Feature/ModTools/CommandBase.cs
+++ b/Module/ModTools/CommandBase.cs
@@ -9,7 +9,7 @@ using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.ModTools
+namespace Noikoio.RegexBot.Module.ModTools
{
[DebuggerDisplay("{Label}-type command")]
abstract class CommandBase
diff --git a/Feature/ModTools/Commands/BanKick.cs b/Module/ModTools/Commands/BanKick.cs
similarity index 99%
rename from Feature/ModTools/Commands/BanKick.cs
rename to Module/ModTools/Commands/BanKick.cs
index 81ded17..9901b86 100644
--- a/Feature/ModTools/Commands/BanKick.cs
+++ b/Module/ModTools/Commands/BanKick.cs
@@ -6,7 +6,7 @@ using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.ModTools.Commands
+namespace Noikoio.RegexBot.Module.ModTools.Commands
{
class BanKick : CommandBase
diff --git a/Feature/ModTools/Commands/Say.cs b/Module/ModTools/Commands/Say.cs
similarity index 98%
rename from Feature/ModTools/Commands/Say.cs
rename to Module/ModTools/Commands/Say.cs
index 8138891..baf2424 100644
--- a/Feature/ModTools/Commands/Say.cs
+++ b/Module/ModTools/Commands/Say.cs
@@ -4,7 +4,7 @@ using Newtonsoft.Json.Linq;
using System;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.ModTools.Commands
+namespace Noikoio.RegexBot.Module.ModTools.Commands
{
class Say : CommandBase
{
diff --git a/Feature/ModTools/ModTools.cs b/Module/ModTools/ModTools.cs
similarity index 94%
rename from Feature/ModTools/ModTools.cs
rename to Module/ModTools/ModTools.cs
index 0430e7e..0d2cc78 100644
--- a/Feature/ModTools/ModTools.cs
+++ b/Module/ModTools/ModTools.cs
@@ -8,14 +8,14 @@ using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
-namespace Noikoio.RegexBot.Feature.ModTools
+namespace Noikoio.RegexBot.Module.ModTools
{
///
- /// Entry point for the ModTools feature.
- /// This feature implements moderation commands that are defined and enabled in configuration.
+ /// ModTools module object.
+ /// Implements moderation commands that are individually defined and enabled in configuration.
///
// We are not using Discord.Net's Commands extension, as it does not allow for changes during runtime.
- class ModTools : BotFeature
+ class ModTools : BotModule
{
public override string Name => "ModTools";
diff --git a/RegexBot.cs b/RegexBot.cs
index 12719b9..97e8b8f 100644
--- a/RegexBot.cs
+++ b/RegexBot.cs
@@ -7,16 +7,16 @@ using System.Threading.Tasks;
namespace Noikoio.RegexBot
{
///
- /// Main class. On start, initializes bot features and passes the DiscordSocketClient to them
+ /// Main class. On start, initializes bot modules and passes the DiscordSocketClient to them
///
class RegexBot
{
private static Configuration _config;
private readonly DiscordSocketClient _client;
- private BotFeature[] _features;
+ private BotModule[] _modules;
internal static Configuration Config => _config;
- internal IEnumerable Features => _features;
+ internal IEnumerable Modules => _modules;
internal RegexBot()
{
@@ -42,13 +42,13 @@ namespace Noikoio.RegexBot
// Hook up handlers for basic functions
_client.Connected += _client_Connected;
- // Initialize features
- _features = new BotFeature[]
+ // Initialize modules
+ _modules = new BotModule[]
{
- new Feature.AutoMod.AutoMod(_client),
- new Feature.ModTools.ModTools(_client),
- new Feature.AutoRespond.AutoRespond(_client),
- new Feature.EntityCache.EntityCache(_client) // EntityCache goes before anything else that uses its data
+ new Module.AutoMod.AutoMod(_client),
+ new Module.ModTools.ModTools(_client),
+ new Module.AutoRespond.AutoRespond(_client),
+ new Module.EntityCache.EntityCache(_client) // EntityCache goes before anything else that uses its data
};
var dlog = Logger.GetLogger("Discord.Net");
_client.Log += async (arg) =>
@@ -56,7 +56,7 @@ namespace Noikoio.RegexBot
String.Format("{0}: {1}{2}", arg.Source, ((int)arg.Severity < 3 ? arg.Severity + ": " : ""),
arg.Message));
- // With features initialized, finish loading configuration
+ // With modules initialized, finish loading configuration
var conf = _config.ReloadServerConfig().Result;
if (conf == false)
{