diff options
author | TrueDoctor <d-kobert@web.de> | 2018-06-11 18:28:13 +0200 |
---|---|---|
committer | TrueDoctor <d-kobert@web.de> | 2018-06-11 18:28:13 +0200 |
commit | af937e7a8519ea3b06be651eb21b54132295c510 (patch) | |
tree | 17dbc28a5e9a75a1a42813a233b1c41390e673c4 /DiscoBot/Commands/Help.cs | |
parent | ad4cb92819976b8add36f047e59335104aa171fe (diff) | |
parent | ff80592d541c79653ef0a7c04e0938d7249069ef (diff) |
Merge branch 'master' of https://github.com/TrueDoctor/DiscoBot
Diffstat (limited to 'DiscoBot/Commands/Help.cs')
-rw-r--r-- | DiscoBot/Commands/Help.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/DiscoBot/Commands/Help.cs b/DiscoBot/Commands/Help.cs index 2bcbd03..c6de4a9 100644 --- a/DiscoBot/Commands/Help.cs +++ b/DiscoBot/Commands/Help.cs @@ -50,11 +50,31 @@ namespace DiscoBot.Commands [Command("help"), Summary("prints the help menu.")] [Alias("Help", "man", "Man")] - public async Task ShowHelpAsync(string command = "") + public async Task ShowHelpAsync(params string[] command_list) { + var command = ""; + if (command_list.Length > 0) { + command = command_list.Aggregate((s, c) => s + " " + c); + } + if (command.Equals(string.Empty)) // return generic Help { - await this.ReplyAsync("```\n[hilfreiche Erklärungen]\nAuflistung aller Commands mit !list commands\n```"); + string res = ""; + + foreach (var com in Commands) + { + int first_column_width = 8; + res += ("!" + com.Name + ": ").AddSpaces(first_column_width) + com.Brief; + + if (com.Description.Length > 1) + { + res += "\n" + "".AddSpaces(first_column_width) + "(\"!man " + com.Name + "\" gibt genauere Informationen)"; + } + + res += "\n\n"; + } + //await this.ReplyAsync("```\n[hilfreiche Erklärungen]\nAuflistung aller Commands mit !list commands\n```"); + await this.ReplyAsync("```xl\n" + res +"\n```"); return; } |