Allow command groups to work correctly

This commit is contained in:
FiniteReality
2016-08-31 15:28:38 +01:00
parent cddc39dfa1
commit c05f44a544

View File

@@ -60,17 +60,12 @@ namespace Discord.Commands
if (groupAttrib != null)
{
string nextGroupPrefix;
if (groupAttrib.Prefix != null)
{
if (groupPrefix != "")
nextGroupPrefix = groupPrefix + " " + groupAttrib.Prefix ?? type.Name;
else
nextGroupPrefix = 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);
}
}