mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-01 11:39:55 +03:00
ton of stuff
- new command handler - multilanguage support - time out support - responses - a ton of stuff
This commit is contained in:
parent
1c9caf6d75
commit
f30485dd71
29 changed files with 1686 additions and 520 deletions
30
Boyfriend/Commands/HelpCommand.cs
Normal file
30
Boyfriend/Commands/HelpCommand.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
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 "Показывает эту справку";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue