geekbot/Geekbot.net/Modules/Help.cs
2017-04-17 16:58:48 +02:00

27 lines
No EOL
832 B
C#

using System.Threading.Tasks;
using Discord.Commands;
using System.Reflection;
namespace Geekbot.net.Modules
{
public class Help : ModuleBase
{
[Command("help"), Summary("List all Commands")]
public async Task GetHelp()
{
var commands = new CommandService();
await commands.AddModulesAsync(Assembly.GetEntryAssembly());
var cmdList = commands.Commands;
var reply = "**Geekbot Command list**\r\n";
foreach (var cmd in cmdList)
{
var param = string.Join(", !",cmd.Aliases);
if (!param.Contains("admin"))
{
reply = reply + $"**{cmd.Name}** (!{param}) - {cmd.Summary}\r\n";
}
}
await ReplyAsync(reply);
}
}
}