Discord.Net
Discord.Net copied to clipboard
Fix: remove Module from _typedModuleDefs
Abstract
This PR fixes the RemoveModuleAsync method from the CommandService class which doesn't remove the values from _typedModuleDefs. This change is required in particular if you want to unload individual assemblies using AssemblyLoadContext.Unload()
Changes
Now the values in _typedModuleDefs are removed when you are calling the RemoveModuleAsync method from CommandService
Tests
With this PR you are able to completley remove the CommandService from assemblies. I tested to load the CommandService in external libraries and remove it with the RemoveModuleAsync, with this PR you are able to unload it.