@@ -38,7 +38,15 @@ namespace Discord.Commands
|
||||
_instance = instance;
|
||||
|
||||
Name = source.Name;
|
||||
Text = groupPrefix + attribute.Text;
|
||||
|
||||
if (attribute.Text == null)
|
||||
Text = groupPrefix;
|
||||
|
||||
if (groupPrefix != "")
|
||||
groupPrefix += " ";
|
||||
|
||||
if (attribute.Text != null)
|
||||
Text = groupPrefix + attribute.Text;
|
||||
|
||||
var aliasesBuilder = ImmutableArray.CreateBuilder<string>();
|
||||
|
||||
|
||||
@@ -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>();
|
||||
@@ -63,9 +61,15 @@ namespace Discord.Commands
|
||||
{
|
||||
string nextGroupPrefix;
|
||||
if (groupAttrib.Prefix != null)
|
||||
{
|
||||
if (groupPrefix != "")
|
||||
groupPrefix += " ";
|
||||
nextGroupPrefix = groupPrefix + groupAttrib.Prefix ?? type.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
nextGroupPrefix = groupPrefix;
|
||||
}
|
||||
SearchClass(type, ReflectionUtils.CreateObject(type, Service, dependencyMap), commands, nextGroupPrefix, dependencyMap);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user