From 3d6baba6c0ab984d8733398a98e33a2be5e3540b Mon Sep 17 00:00:00 2001 From: Dultus Date: Thu, 6 Apr 2023 15:38:47 +0200 Subject: [PATCH] Removed where ENUM : class clause and added assembly requirement with description. --- Discord/Controller/EventController.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Discord/Controller/EventController.cs b/Discord/Controller/EventController.cs index 980fa47..ced3d3a 100644 --- a/Discord/Controller/EventController.cs +++ b/Discord/Controller/EventController.cs @@ -14,7 +14,7 @@ namespace Discord.Controller /// The base enum that will get separated and passed to the actual controller /// Passed Ids by the event e.g e.Interaction.Data.CustomId /// The passed Event args - public static void InvokeEventControllerClass(string ids, object e) where ENUM : class + public static void InvokeEventControllerClass(string ids, object e) { string[] splittedIds = ids.Split(','); var category = Converter.InteractionFormatter.GetFirstEnumFromIdAndRemove(ref splittedIds); @@ -48,10 +48,11 @@ namespace Discord.Controller /// The given Ids without category enum. /// The namespace with all the required events. E.g. Project_Sipster.DiscordBarista.Function.Partnership.Events /// The passed event from the - just needs to be put it as a param and passed over to the controller. - public static void ExecuteController(string[] ids, string nspace, object e) + /// The executing assembly. Get it via + public static void ExecuteController(string[] ids, string nspace, object e, Assembly execAssembly) { var category = Converter.InteractionFormatter.GetFirstEnumFromId(ref ids); - var q = (from t in Assembly.GetExecutingAssembly().GetTypes() + var q = (from t in execAssembly.GetTypes() where t.IsClass && t.Namespace == nspace select t).ToList(); List methods = new();