Discord.Net icon indicating copy to clipboard operation
Discord.Net copied to clipboard

Fix: remove Module from _typedModuleDefs

Open akaJuliaan opened this issue 3 years ago • 0 comments


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.

akaJuliaan avatar Aug 04 '22 20:08 akaJuliaan