diff --git a/MEE7-Discord-Bot/Backend/Program.cs b/MEE7-Discord-Bot/Backend/Program.cs index 5f964f6..01d69ef 100644 --- a/MEE7-Discord-Bot/Backend/Program.cs +++ b/MEE7-Discord-Bot/Backend/Program.cs @@ -2,6 +2,7 @@ using Discord.WebSocket; using MEE7.Backend; using MEE7.Backend.HelperFunctions; +using MEE7.Commands.Edit; using MEE7.Configuration; using NAudio.Wave; using System; @@ -523,7 +524,7 @@ static void HandleConsoleCommandsLoop() { ConsoleWrapper.WriteLine(e, ConsoleColor.Red); } - } + } else if (!input.StartsWith("/")) { if (CurrentChannel == null) @@ -721,13 +722,20 @@ static void HandleConsoleCommandsLoop() { try { - //ConsoleWrapper.WriteLine(commandTypes[0].GetConstructor(new Type[] { typeof(string), typeof(string), typeof(bool), typeof(bool) }).GetCustomAttributes(true).Length , ConsoleColor.Cyan); ConsoleWrapper.WriteLine("Command | Description\n" + "---------------|--------------\n" + commands.Select(x => $"{x.CommandLine} | {x.Desc}").Combine("\n"), ConsoleColor.Cyan); } catch (Exception e) { ConsoleWrapper.WriteLine(e.ToString(), ConsoleColor.Red); } } + else if (input.StartsWith("/printEditCommands")) + { + try + { + ConsoleWrapper.WriteLine(Edit.EditCommandsOverview, ConsoleColor.Cyan); + } + catch (Exception e) { ConsoleWrapper.WriteLine(e.ToString(), ConsoleColor.Red); } + } else ConsoleWrapper.WriteLine("I dont know that command.", ConsoleColor.Red); } diff --git a/MEE7-Discord-Bot/BuildDate.txt b/MEE7-Discord-Bot/BuildDate.txt index f6e054d..a80f691 100644 --- a/MEE7-Discord-Bot/BuildDate.txt +++ b/MEE7-Discord-Bot/BuildDate.txt @@ -1 +1 @@ -19.02.2024 20:56:19,60 +20.02.2024 0:10:05,13 diff --git a/MEE7-Discord-Bot/Commands/Edit/Backend/Edit.cs b/MEE7-Discord-Bot/Commands/Edit/Backend/Edit.cs index f1618cd..b914198 100644 --- a/MEE7-Discord-Bot/Commands/Edit/Backend/Edit.cs +++ b/MEE7-Discord-Bot/Commands/Edit/Backend/Edit.cs @@ -159,8 +159,9 @@ public class EditVariable { public string VarName; } private static IEnumerable Commands; private static Dictionary groupHelpMenus = new Dictionary(); + public static string EditCommandsOverview { get; private set; } - public Edit() : base("edit", "This is a little more advanced command which allows you to chain together functions that were made specific for this command. " + + public Edit() : base("edit", "This is a more advanced command which allows you to chain together functions that were made specific for this command. " + $"Shortcut: **{Program.Prefix}-**\nFor more information just type **{Program.Prefix}edit**.") { Commands = new List(); @@ -172,6 +173,7 @@ public class EditVariable { public string VarName; } $"\neg. {PrefixAndCommand} \"omegaLUL\" > swedish > Aestheticify\n" + $"\nIf you want to find more commands you can write \"{PrefixAndCommand} help [groupName]\"" + "The following command groups are currently loaded:"); + EditCommandsOverview = ""; // Load Functions Type[] classesWithEditCommands = (from domainAssembly in AppDomain.CurrentDomain.GetAssemblies() @@ -274,6 +276,10 @@ void AddToHelpmenus(string Name, EditCommand[] editCommands) $"{new string(Enumerable.Repeat(' ', maxlength - c.Command.Length - 1).ToArray())}{c.Desc}\n"). Combine() + ""); } + EditCommandsOverview += $"{Name} | Description\n" + + $"-------|--------------\n" + + editCommands.Select(x => $"{x.Command} | {x.Desc}").Combine("\n") + + "\n\n"; } public override void Execute(IMessage message) {