Add role-reaction help command
This commit is contained in:
parent
9fced13394
commit
5cf8c3f08b
@ -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<string>("Discord:Prefix", Context.Guild.Id, "!")}role add <emote> <role>");
|
||||
sb.AppendLine("To add many role-reactions to a message add more sets of emote and role:");
|
||||
sb.AppendLine($"{ConfigurationRepository.GetValue<string>("Discord:Prefix", Context.Guild.Id, "!")}role add <emote> <role> <emote> <role> <emote> <role>");
|
||||
sb.AppendLine("To remove a role-reaction from a message:");
|
||||
sb.AppendLine($"{ConfigurationRepository.GetValue<string>("Discord:Prefix", Context.Guild.Id, "!")}role remove <emote>");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("To view this help:");
|
||||
sb.AppendLine($"{ConfigurationRepository.GetValue<string>("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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user