Browse Source

Merge 8ab00930f0 into 9fcf88b7ac

pull/334/merge
Finite Reality GitHub 8 years ago
parent
commit
bb0cd23929
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      src/Discord.Net.Commands/CommandService.cs

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

@@ -95,6 +95,16 @@ namespace Discord.Commands
{ {
foreach (var type in assembly.ExportedTypes) foreach (var type in assembly.ExportedTypes)
{ {
//Ensure that we weren't declared as a submodule
if (type.DeclaringType != null)
{
if (_moduleDefs.ContainsKey(type.DeclaringType))
continue;

var declaringTypeInfo = type.DeclaringType.GetTypeInfo();
if (_moduleTypeInfo.IsAssignableFrom(declaringTypeInfo))
continue;
}
if (!_moduleDefs.ContainsKey(type)) if (!_moduleDefs.ContainsKey(type))
{ {
var typeInfo = type.GetTypeInfo(); var typeInfo = type.GetTypeInfo();


Loading…
Cancel
Save