feature: allow for inherited commands in modules (#1521)

This commit is contained in:
OhB00
2020-06-18 04:53:26 +01:00
committed by GitHub
parent ab32607bcc
commit a51cdf60a2

View File

@@ -135,7 +135,8 @@ namespace Discord.Commands
if (builder.Name == null) if (builder.Name == null)
builder.Name = typeInfo.Name; builder.Name = typeInfo.Name;
var validCommands = typeInfo.DeclaredMethods.Where(IsValidCommandDefinition); // Get all methods (including from inherited members), that are valid commands
var validCommands = typeInfo.GetMethods().Where(IsValidCommandDefinition);
foreach (var method in validCommands) foreach (var method in validCommands)
{ {