Browse Source

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

tags/2.3.0
OhB00 GitHub 4 years ago
parent
commit
a51cdf60a2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs

+ 2
- 1
src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs View File

@@ -135,7 +135,8 @@ namespace Discord.Commands
if (builder.Name == null)
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)
{


Loading…
Cancel
Save