Fix: remove Module from _typedModuleDefs (#2417)

This commit is contained in:
Julian
2022-09-02 23:31:51 +02:00
committed by GitHub
parent b967e6907c
commit fca9c6b618

View File

@@ -270,6 +270,11 @@ namespace Discord.Commands
await _moduleLock.WaitAsync().ConfigureAwait(false); await _moduleLock.WaitAsync().ConfigureAwait(false);
try try
{ {
var typeModulePair = _typedModuleDefs.FirstOrDefault(x => x.Value.Equals(module));
if (!typeModulePair.Equals(default(KeyValuePair<Type, ModuleInfo>)))
_typedModuleDefs.TryRemove(typeModulePair.Key, out var _);
return RemoveModuleInternal(module); return RemoveModuleInternal(module);
} }
finally finally