Added new (unfinished) classes

Will begin development of AutoRespond first. A (planned) feature list
was added in the Feature class's documentation.
This commit is contained in:
Noikoio 2017-08-09 19:29:45 -07:00
parent 1351777e0a
commit e020b328c6
3 changed files with 73 additions and 2 deletions

View file

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Discord.WebSocket;
using Newtonsoft.Json.Linq;
namespace Noikoio.RegexBot.Feature.AutoMod
{
/// <summary>
/// Implements per-message regex matching and executes customizable responses.
/// The name RegexBot comes from the existence of this feature.
///
/// Strictly for use as a moderation tool only. Triggers that respond only to messages
/// should be configured using <see cref="AutoRespond"/>.
/// </summary>
class AutoMod : BotFeature
{
public override string Name => "AutoMod";
public AutoMod(DiscordSocketClient client) : base(client)
{
throw new NotImplementedException();
}
public override Task<object> ProcessConfiguration(JToken configSection)
{
throw new NotImplementedException();
}
}
}

View file

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Discord.WebSocket;
using Newtonsoft.Json.Linq;
namespace Noikoio.RegexBot.Feature.AutoRespond
{
/// <summary>
/// Similar to <see cref="AutoMod"/>, but lightweight.
/// Provides the capability to define autoresponses for fun or informational purposes.
/// <para>
/// The major differences between this and <see cref="AutoMod"/> include:
/// <list type="bullet">
/// <item><description>Does not listen for message edits.</description></item>
/// <item><description>Moderators are not exempt from any defined triggers by default.</description></item>
/// <item><description>Responses are limited to only two types, and only one is allowed per rule.</description></item>
/// <item><description>Does not support fine-grained matching options.</description></item>
/// <item><description>Support for rate limiting.</description></item>
/// </list>
/// </para>
/// </summary>
class AutoRespond : BotFeature
{
public override string Name => "AutoRespond";
public AutoRespond(DiscordSocketClient client) : base(client)
{
throw new NotImplementedException();
}
[ConfigSection("autoresponses")]
public override Task<object> ProcessConfiguration(JToken configSection)
{
throw new NotImplementedException();
}
}
}

View file

@ -44,8 +44,9 @@ namespace Noikoio.RegexBot
// Initialize features
_features = new BotFeature[]
{
new Feature.RegexResponder.EventProcessor(_client),
new Feature.ModTools.CommandListener(_client)
new Feature.AutoMod.AutoMod(_client),
new Feature.ModTools.CommandListener(_client),
new Feature.AutoRespond.AutoRespond(_client)
};
var dlog = Logger.GetLogger("Discord.Net");
_client.Log += async (arg) =>