287bb33d77
Modules will now be named based on their existing class name. Their respective configuration sections are now also defined by the same value. Documentation has been updated to reflect this.
25 lines
923 B
C#
25 lines
923 B
C#
using Discord.WebSocket;
|
|
using Newtonsoft.Json.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Noikoio.RegexBot.Module.ModCommands.Commands
|
|
{
|
|
class ConfReload : Command
|
|
{
|
|
// No configuration.
|
|
public ConfReload(ModCommands l, string label, JObject conf) : base(l, label, conf) { }
|
|
|
|
// Usage: (command)
|
|
public override async Task Invoke(SocketGuild g, SocketMessage msg)
|
|
{
|
|
bool status = await RegexBot.Config.ReloadServerConfig();
|
|
string res;
|
|
if (status) res = ":white_check_mark: Configuration reloaded with no issues. Check the console to verify.";
|
|
else res = ":x: Reload failed. Check the console.";
|
|
await msg.Channel.SendMessageAsync(res);
|
|
}
|
|
|
|
// Crazy idea: somehow redirect all logging messages created from invoking config reloading
|
|
// and pass them onto the invoking channel.
|
|
}
|
|
}
|