RegexBot/Feature/ModTools/TestCommand.cs
Noikoio e3d40a5f60 Added ModTools feature
Implements moderation commands that are fully configurable.
Commands are defined in configuration per-server under "modtools",
and allows for custom command triggers as well as individual options.

For now, only commands with "kick" and "ban" capabilities are
available, but more will be added in the near future.
2017-08-06 13:05:44 -07:00

24 lines
759 B
C#

using Discord.WebSocket;
using Newtonsoft.Json.Linq;
using Noikoio.RegexBot.ConfigItem;
using System.Threading.Tasks;
namespace Noikoio.RegexBot.Feature.ModTools
{
#if DEBUG
[CommandType("test")]
class TestCommand : CommandBase
{
public TestCommand(CommandListener l, JObject conf) : base(l, conf) {
bool? doCrash = conf["crash"]?.Value<bool>();
if (doCrash.HasValue && doCrash.Value)
throw new RuleImportException("Throwing exception in constructor upon request.");
}
public override async Task Invoke(SocketGuild g, SocketMessage msg)
{
await msg.Channel.SendMessageAsync("This is the test command. It is labeled: " + this.Label);
}
}
#endif
}