Browse Source

Fix: remove Module from _typedModuleDefs (#2417)

tags/3.8.1
Julian GitHub 2 years ago
parent
commit
fca9c6b618
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/Discord.Net.Commands/CommandService.cs

+ 5
- 0
src/Discord.Net.Commands/CommandService.cs View File

@@ -270,6 +270,11 @@ namespace Discord.Commands
await _moduleLock.WaitAsync().ConfigureAwait(false);
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);
}
finally


Loading…
Cancel
Save