Browse Source

Allow nested ModuleBase classes to be built when declared from non-module classes. (#969)

* Allow modules to be built regardless of their declaring type.

* Need to exclude submodules.
tags/2.0
Alex Gravely Christopher F 7 years ago
parent
commit
4edbd8d4b9
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs

+ 1
- 2
src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs View File

@@ -48,8 +48,7 @@ namespace Discord.Commands
/*if (!validTypes.Any())
throw new InvalidOperationException("Could not find any valid modules from the given selection");*/

var topLevelGroups = validTypes.Where(x => x.DeclaringType == null);
var subGroups = validTypes.Intersect(topLevelGroups);
var topLevelGroups = validTypes.Where(x => x.DeclaringType == null || !IsValidModuleDefinition(x.DeclaringType.GetTypeInfo()));

var builtTypes = new List<TypeInfo>();



Loading…
Cancel
Save