This repository has been archived on 2024-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
OctobotStealth/Boyfriend/Commands/HelpCommand.cs

22 lines
789 B
C#
Raw Normal View History

using Discord.Commands;
2022-05-14 16:12:24 +03:00
using Humanizer;
namespace Boyfriend.Commands;
public class HelpCommand : Command {
2022-05-14 16:12:24 +03:00
public override string[] Aliases { get; } = {"help", "помощь", "справка"};
public override int ArgsLengthRequired => 0;
2022-02-02 16:14:26 +03:00
2022-05-14 16:12:24 +03:00
public override Task Run(SocketCommandContext context, string[] args) {
var prefix = Boyfriend.GetGuildConfig(context.Guild.Id)["Prefix"];
var toSend = Boyfriend.StringBuilder.Append(Messages.CommandHelp);
2022-05-14 16:12:24 +03:00
foreach (var command in CommandHandler.Commands)
toSend.Append(
$"\n`{prefix}{command.Aliases[0]}`: {Utils.GetMessage($"CommandDescription{command.Aliases[0].Titleize()}")}");
Output(ref toSend);
toSend.Clear();
2022-05-14 16:12:24 +03:00
return Task.CompletedTask;
}
2022-05-14 16:12:24 +03:00
}