|
|
@@ -48,8 +48,6 @@ namespace Discord.Commands |
|
|
|
|
|
|
|
private void SearchClass(TypeInfo parentType, object instance, List<Command> commands, string groupPrefix, IDependencyMap dependencyMap) |
|
|
|
{ |
|
|
|
if (groupPrefix != "") |
|
|
|
groupPrefix += " "; |
|
|
|
foreach (var method in parentType.DeclaredMethods) |
|
|
|
{ |
|
|
|
var cmdAttr = method.GetCustomAttribute<CommandAttribute>(); |
|
|
@@ -62,10 +60,12 @@ namespace Discord.Commands |
|
|
|
if (groupAttrib != null) |
|
|
|
{ |
|
|
|
string nextGroupPrefix; |
|
|
|
if (groupAttrib.Prefix != null) |
|
|
|
nextGroupPrefix = groupPrefix + groupAttrib.Prefix ?? type.Name; |
|
|
|
|
|
|
|
if (groupPrefix != "") |
|
|
|
nextGroupPrefix = groupPrefix + " " + (groupAttrib.Prefix ?? type.Name.ToLowerInvariant()); |
|
|
|
else |
|
|
|
nextGroupPrefix = groupPrefix; |
|
|
|
nextGroupPrefix = groupAttrib.Prefix ?? type.Name.ToLowerInvariant(); |
|
|
|
|
|
|
|
SearchClass(type, ReflectionUtils.CreateObject(type, Service, dependencyMap), commands, nextGroupPrefix, dependencyMap); |
|
|
|
} |
|
|
|
} |
|
|
|