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
l1ttleO f30485dd71
ton of stuff
- new command handler
- multilanguage support
- time out support
- responses
- a ton of stuff
2022-01-18 22:38:15 +05:00

30 lines
No EOL
985 B
C#

using Discord.Commands;
// ReSharper disable UnusedType.Global
// ReSharper disable UnusedMember.Global
namespace Boyfriend.Commands;
public class HelpCommand : Command {
public override async Task Run(SocketCommandContext context, string[] args) {
var nl = Environment.NewLine;
var toSend = string.Format(Messages.CommandHelp, nl);
var prefix = Boyfriend.GetGuildConfig(context.Guild).Prefix;
toSend = CommandHandler.Commands.Aggregate(toSend,
(current, command) => current + $"`{prefix}{command.GetAliases()[0]}`: {command.GetSummary()}{nl}");
await context.Channel.SendMessageAsync(toSend);
}
public override List<string> GetAliases() {
return new List<string> {"help", "помощь", "справка"};
}
public override int GetArgumentsAmountRequired() {
return 0;
}
public override string GetSummary() {
return "Показывает эту справку";
}
}