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();