Add support for void-returning commands

This commit is contained in:
RogueException
2017-04-07 05:48:33 -03:00
parent bceb72dd92
commit a6469e9021
2 changed files with 18 additions and 9 deletions

View File

@@ -252,7 +252,7 @@ namespace Discord.Commands
private static bool IsValidCommandDefinition(MethodInfo methodInfo)
{
return methodInfo.IsDefined(typeof(CommandAttribute)) &&
methodInfo.ReturnType == typeof(Task) &&
(methodInfo.ReturnType == typeof(Task) || methodInfo.ReturnType == typeof(void)) &&
!methodInfo.IsStatic &&
!methodInfo.IsGenericMethod;
}