From 4c43b2130321948d46d6e59d15068c57b5a07778 Mon Sep 17 00:00:00 2001 From: Kobert-P Date: Thu, 7 Jun 2018 20:31:22 +0200 Subject: Help.json now contains a brief description that is output for global !help --- DiscoBot/Auxiliary/CommandInfo.cs | 5 ++++- DiscoBot/Commands/Help.cs | 16 +++++++++++++++- DiscoBot/Help.json | 35 ++++++++++++++++++++--------------- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/DiscoBot/Auxiliary/CommandInfo.cs b/DiscoBot/Auxiliary/CommandInfo.cs index 90fbbc7..dfed417 100644 --- a/DiscoBot/Auxiliary/CommandInfo.cs +++ b/DiscoBot/Auxiliary/CommandInfo.cs @@ -8,10 +8,11 @@ namespace DiscoBot.Auxiliary { public struct CommandInfo { - public CommandInfo(string name, string[] description, string scope) + public CommandInfo(string name, string brief, string[] description, string scope) { this.Name = name; this.Scope = scope; + this.Brief = brief; this.Description = description; } @@ -19,6 +20,8 @@ namespace DiscoBot.Auxiliary public string Scope { get; } + public string Brief { get; } + public string[] Description { get; } public string GetDescription() diff --git a/DiscoBot/Commands/Help.cs b/DiscoBot/Commands/Help.cs index 2bcbd03..96e7d46 100644 --- a/DiscoBot/Commands/Help.cs +++ b/DiscoBot/Commands/Help.cs @@ -54,7 +54,21 @@ namespace DiscoBot.Commands { 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) + { + res += "!" + com.Name + ": " + com.Brief; + + if (com.Description.Length > 1) + { + res += "\n\t(!man " + com.Name + " gibt genauere Informationen)"; + } + + res += "\n"; + } + //await this.ReplyAsync("```\n[hilfreiche Erklärungen]\nAuflistung aller Commands mit !list commands\n```"); + await this.ReplyAsync("```xl\n" + res +"\n```"); return; } diff --git a/DiscoBot/Help.json b/DiscoBot/Help.json index 737ddf7..0407deb 100644 --- a/DiscoBot/Help.json +++ b/DiscoBot/Help.json @@ -3,35 +3,40 @@ { "Name": "List", "Scope": "All", + "Brief": "Testbeschreibung", "Description": [ "Testbeschreibung" ] }, { "Name": "LE", "Scope": "All", + "Brief": "Ändert dein Leben - im wahrsten Sinne des Wortes", "Description": [ - "Use !LE to display, set, or change LE value\n\n", - " !LE Display values\n", - " !LE 30 Set LE to 30\n", - " !LE 30 Set LE to 30\n", - " !LE +5 Increment LE by 5 (up to the maximum)\n", - " !LE ++5 Increment LE by 5 (ignoring the maximum)\n", - " !LE -5 Decrease LE by 5\n \n" - ], + "Mit !LE zeigt man die Lebensenergie an, ändert sie, oder setzt sie auf einen neuen Wert\n\n", + " !LE Zeigt Lebensenergie an\n", + " !LE 30 Setzt LE auf 30\n", + " !LE +5 Erhöht LE um 5 (bis zum Maximum)\n", + " !LE ++5 Erhöht LE um 5 (ignoriert Maximum)\n", + " !LE -5 Verringert LE um 5\n \n" + ] }, { "Name": "AE", "Scope": "All", - "Description": ["Use !AE (or !Asp) to display, set, or change AE/Asp value\n\n", - " !AE Display values\n", - " !AE 30 Set Asp to 30\n", - " !AE +5 Increment Asp by 5 (up to the maximum)\n", - " !AE ++5 Increment Asp by 5 (ignoring the maximum)\n", - " !AE -5 Decrease Asp by 5 (down to 0)\n"], + "Brief": "Ändert Astralenergie", + "Description": [ + "Mit !AE (oder !Asp) zeigt man die Astralenergie an, ändert sie, oder setzt sie auf einen neuen Wert\n\n", + " !AE Zeigt Astralenergie an\n", + " !AE 30 Setzt Asp auf 30\n", + " !AE +5 Erhöht Asp um 5 (bis zum Maximum)\n", + " !AE ++5 Erhöht Asp um 5 (ignoriert Maximum)\n", + " !AE -5 Verringert Asp um 5 (Minimum 0)\n" + ] }, { "Name": "Gm", "Scope": "Meister", - "Description": ["Gm Aktionen"] + "Brief": "Testbeschreibung", + "Description": [ "Gm Aktionen" ] } ] } -- cgit v1.2.3-70-g09d2