From 380d9ec6048663b0e497e2437222d783236b864f Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Fri, 15 Jun 2018 09:58:24 +0200 Subject: Added Properties Class auto load last settings removed sound enumerable moved Sonds to properties moved Commands to properties --- DiscoBot/Commands/Help.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'DiscoBot/Commands') diff --git a/DiscoBot/Commands/Help.cs b/DiscoBot/Commands/Help.cs index 7b77e2b..bf58070 100644 --- a/DiscoBot/Commands/Help.cs +++ b/DiscoBot/Commands/Help.cs @@ -5,9 +5,11 @@ namespace DiscoBot.Commands using System; using System.Collections.Generic; using System.IO; + using System.Security.Cryptography; using System.Threading.Tasks; using DiscoBot.Auxiliary; + using DiscoBot.DSA_Game; using Discord.Commands; @@ -19,7 +21,7 @@ namespace DiscoBot.Commands { static Help() { - TextReader stream = new StreamReader(@"..\..\Help.json"); // Load command-description file + /*TextReader stream = new StreamReader(@"..\..\Help.json"); // Load command-description file var reader = new JsonTextReader(stream); // create stream reader reader.Read(); // step into structure, until the array starts @@ -35,23 +37,23 @@ namespace DiscoBot.Commands catch (Exception e) { // ignored - } + }*/ } - public static List Commands { get; } = new List(); + //public static List Commands { get; } = new List(); public static string Get_Specific_Help(string command) { // return command specific help - var com = Commands.OrderBy(x => SpellCorrect.CompareEasy(x.Name, command.ToLower())).First(); // get best fit command + var com = Dsa.Properties.CommandInfos.OrderBy(x => SpellCorrect.CompareEasy(x.Name, command.ToLower())).First(); // get best fit command return com.GetDescription(); } public static string Get_Generic_Help() { string res = ""; - foreach (var com in Commands) + foreach (var com in Dsa.Properties.CommandInfos) { int first_column_width = 8; res += ("!" + com.Name + ": ").AddSpaces(first_column_width) + com.Brief; -- cgit v1.2.3-54-g00ecf