2022-12-06 18:33:46 +03:00
|
|
|
using Humanizer;
|
2022-01-18 20:38:15 +03:00
|
|
|
|
|
|
|
namespace Boyfriend.Commands;
|
|
|
|
|
2022-09-18 17:41:29 +03:00
|
|
|
public sealed class HelpCommand : ICommand {
|
|
|
|
public string[] Aliases { get; } = { "help", "помощь", "справка" };
|
2022-02-02 16:14:26 +03:00
|
|
|
|
2022-09-18 17:41:29 +03:00
|
|
|
public Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) {
|
2022-08-30 18:15:01 +03:00
|
|
|
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-12-06 18:33:46 +03:00
|
|
|
cmd.Reply(toSend.ToString(), ReplyEmojis.Help);
|
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-09-18 17:41:29 +03:00
|
|
|
}
|