2022-08-30 18:15:01 +03:00
|
|
|
|
using Humanizer;
|
2022-01-18 20:38:15 +03:00
|
|
|
|
|
|
|
|
|
namespace Boyfriend.Commands;
|
|
|
|
|
|
|
|
|
|
public class HelpCommand : Command {
|
2022-08-30 18:15:01 +03:00
|
|
|
|
public override string[] Aliases { get; } = { "help", "помощь", "справка" };
|
2022-02-02 16:14:26 +03:00
|
|
|
|
|
2022-08-30 18:15:01 +03:00
|
|
|
|
public override Task Run(CommandProcessor cmd, string[] args) {
|
|
|
|
|
var prefix = Boyfriend.GetGuildConfig(cmd.Context.Guild.Id)["Prefix"];
|
2022-05-14 16:12:24 +03:00
|
|
|
|
var toSend = Boyfriend.StringBuilder.Append(Messages.CommandHelp);
|
2022-01-18 20:38:15 +03:00
|
|
|
|
|
2022-08-30 18:15:01 +03:00
|
|
|
|
foreach (var command in CommandProcessor.Commands)
|
2022-05-14 16:12:24 +03:00
|
|
|
|
toSend.Append(
|
|
|
|
|
$"\n`{prefix}{command.Aliases[0]}`: {Utils.GetMessage($"CommandDescription{command.Aliases[0].Titleize()}")}");
|
2022-08-30 18:15:01 +03:00
|
|
|
|
cmd.Reply(toSend.ToString(), ":page_facing_up: ");
|
2022-05-14 16:12:24 +03:00
|
|
|
|
toSend.Clear();
|
2022-01-18 20:38:15 +03:00
|
|
|
|
|
2022-05-14 16:12:24 +03:00
|
|
|
|
return Task.CompletedTask;
|
2022-01-18 20:38:15 +03:00
|
|
|
|
}
|
2022-05-14 16:12:24 +03:00
|
|
|
|
}
|