Browse Source

Use GetMethods instead of DeclaredMethods to allow for inherited commands in modules.

pull/1521/head
Bryce Sullivan 5 years ago
parent
commit
7eab56c48a
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