From 8eeb66302a494853aee10c31f07752cb2c0b1655 Mon Sep 17 00:00:00 2001 From: Kobert-P Date: Mon, 11 Jun 2018 22:48:45 +0200 Subject: !list help --- DiscoBot/Commands/Help.cs | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'DiscoBot/Commands/Help.cs') diff --git a/DiscoBot/Commands/Help.cs b/DiscoBot/Commands/Help.cs index c6de4a9..7b77e2b 100644 --- a/DiscoBot/Commands/Help.cs +++ b/DiscoBot/Commands/Help.cs @@ -48,8 +48,26 @@ namespace DiscoBot.Commands return com.GetDescription(); } + public static string Get_Generic_Help() + { + 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"; + } + return res; + } + [Command("help"), Summary("prints the help menu.")] - [Alias("Help", "man", "Man")] + [Alias("Help", "man", "Man", "Hilfe", "hilfe", "h")] public async Task ShowHelpAsync(params string[] command_list) { var command = ""; @@ -59,20 +77,8 @@ namespace DiscoBot.Commands if (command.Equals(string.Empty)) // return generic Help { - 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)"; - } + string res = Get_Generic_Help(); - 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; -- cgit v1.2.3-70-g09d2