Browse Source

Fix #311

TypeInfo.BaseType will likely return the same Type if all modules derive from
ModuleBase or some common subclass of it. Making it appear as if only one module
is registered.

Changed to TypeInfo.AsType for expected behavior.
tags/1.0-rc
james7132 8 years ago
parent
commit
3841eb616c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Commands/CommandService.cs

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

@@ -116,7 +116,7 @@ namespace Discord.Commands
private ModuleInfo AddModuleInternal(TypeInfo typeInfo, IDependencyMap dependencyMap)
{
var moduleDef = new ModuleInfo(typeInfo, this, dependencyMap);
_moduleDefs[typeInfo.BaseType] = moduleDef;
_moduleDefs[typeInfo.AsType()] = moduleDef;

foreach (var cmd in moduleDef.Commands)
_map.AddCommand(cmd);


Loading…
Cancel
Save