1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00
Octobot/Boyfriend/Commands/HelpModule.cs
2021-12-15 11:19:14 +05:00

25 lines
No EOL
914 B
C#

using Discord.Commands;
// ReSharper disable UnusedType.Global
// ReSharper disable UnusedMember.Global
namespace Boyfriend.Commands;
public class HelpModule : ModuleBase<SocketCommandContext> {
[Command("help")]
[Summary("Показывает эту справку")]
[Alias("помощь", "справка")]
public Task Run() {
var nl = Environment.NewLine;
var toSend = $"Справка по командам:{nl}";
var prefix = Boyfriend.GetGuildConfig(Context.Guild).Prefix;
foreach (var command in EventHandler.Commands.Commands) {
var aliases = command.Aliases.Aggregate("", (current, alias) =>
current + (current == "" ? "" : $", {prefix}") + alias);
toSend += $"`{prefix}{aliases}`: {command.Summary}{nl}";
}
Context.Channel.SendMessageAsync(toSend);
return Task.CompletedTask;
}
}