From f89f308c525e9deebc6d2cf6416e27dfe1a299dc Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 16:03:38 +0200 Subject: Cleanup DiscoBot Project --- DiscoBot/Commands/Help.cs | 99 ----------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 DiscoBot/Commands/Help.cs (limited to 'DiscoBot/Commands/Help.cs') diff --git a/DiscoBot/Commands/Help.cs b/DiscoBot/Commands/Help.cs deleted file mode 100644 index 4c378c9..0000000 --- a/DiscoBot/Commands/Help.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System.Linq; - -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; - - using Newtonsoft.Json; - - using CommandInfo = DiscoBot.Auxiliary.CommandInfo; - - public class Help : ModuleBase - { - static Help() - { - /*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 - reader.Read(); - reader.Read(); - - try - { - var test = new JsonSerializer().Deserialize>(reader); // Deserialize Data and create CommandInfo Struct - - Commands.AddRange(test); // Add new CommandInfos to List - } - catch (Exception e) - { - // ignored - }*/ - } - - //public static List Commands { get; } = new List(); - - - public static string Get_Specific_Help(string command) - { - // return command specific help - var com = DSA_Game.Save.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 DSA_Game.Save.Properties.CommandInfos) - { - 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", "Hilfe", "hilfe", "h")] - 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 - { - string res = Get_Generic_Help(); - - //await this.ReplyAsync("```\n[hilfreiche Erklärungen]\nAuflistung aller Commands mit !list commands\n```"); - await this.ReplyAsync("```xl\n" + res +"\n```"); - return; - } - - - - // return command specific help - //var com = Commands.OrderBy(x => SpellCorrect.CompareEasy(x.Name, command.ToLower())).First(); // get best fit command - - //await this.ReplyAsync("```xl\n" + com.GetDescription() + "\n```"); - await this.ReplyAsync("```xl\n" + Get_Specific_Help(command) + "\n```"); - }*/ - } -} -- cgit v1.2.3-70-g09d2