diff --git a/ChaosBot/Discord/Modules/Admin/Role.cs b/ChaosBot/Discord/Modules/Admin/Role.cs index bf99aa7..46f7a37 100644 --- a/ChaosBot/Discord/Modules/Admin/Role.cs +++ b/ChaosBot/Discord/Modules/Admin/Role.cs @@ -4,9 +4,11 @@ using Discord.Commands; using System.Threading.Tasks; using System.Linq; using System.Reflection; +using System.Text; using System.Text.RegularExpressions; using ChaosBot.Discord.PreConditions; using ChaosBot.Models; +using ChaosBot.Repositories; using Microsoft.EntityFrameworkCore; using NLog; @@ -16,6 +18,45 @@ namespace ChaosBot.Discord.Modules.Admin { private static readonly ILogger Logger = Program.Logger; + [Command("role")] + [Alias("role info")] + [CheckCommandPerm("Admin")] + public async Task RoleInfoCommand() + { + try + { + var sb = new StringBuilder(); + var embed = new EmbedBuilder(); + + embed.WithColor(new Color(255, 255, 0)); + embed.Title = $"Role Management Help"; + sb.AppendLine(); + sb.AppendLine("To add a role-reaction to a message:"); + sb.AppendLine($"{ConfigurationRepository.GetValue("Discord:Prefix", Context.Guild.Id, "!")}role add "); + sb.AppendLine("To add many role-reactions to a message add more sets of emote and role:"); + sb.AppendLine($"{ConfigurationRepository.GetValue("Discord:Prefix", Context.Guild.Id, "!")}role add "); + sb.AppendLine("To remove a role-reaction from a message:"); + sb.AppendLine($"{ConfigurationRepository.GetValue("Discord:Prefix", Context.Guild.Id, "!")}role remove "); + sb.AppendLine(); + sb.AppendLine("To view this help:"); + sb.AppendLine($"{ConfigurationRepository.GetValue("Discord:Prefix", Context.Guild.Id, "!")}role help"); + + /* + * Add the string to the Embed + */ + embed.Description = sb.ToString(); + + /* + * Reply with the Embed created above + */ + await ReplyAsync(null, false, embed.Build()); + } + catch (Exception ex) + { + Logger.Error($"{MethodBase.GetCurrentMethod().ReflectedType.FullName}: Exception [{ex}] thrown, <[{ex.Message}]>."); + } + } + [Command("role add")] [CheckCommandPerm("Admin")] public async Task RoleAddCommand(params string[] parameters) @@ -91,4 +132,4 @@ namespace ChaosBot.Discord.Modules.Admin } } } -} \ No newline at end of file +}