How to set Object from Inherited class with Reflections

Im working on a framework for one of my libraries and my goal is to create a similar structure as Discord.NET
as stated in #How to create a structure like Discord.NET i have an issue with my Context object
Setting it using module.ModuleInteractionBase = (InteractionBase)Activator.CreateInstance(moduleType); seems to work but the instance its setting seems to be different from what my command handler class inherits
        public class Commands : InteractionBase
        {

            [Command("ping", "Simple Ping Command")]
            [EnabledInDms(false)]
            [PermissionGroup(PermissionGroup.PermissionGroups.Agent)]
            public async Task HandleCommand(string arg1, string[] arg2 = null)
            {
                await Console.Out.WriteLineAsync(Context.InteractionName);
            }
        }
Was this page helpful?