diff --git a/src/Discord.Net.Commands/Command.cs b/src/Discord.Net.Commands/Command.cs index 53c4758d5..f9578d154 100644 --- a/src/Discord.Net.Commands/Command.cs +++ b/src/Discord.Net.Commands/Command.cs @@ -81,7 +81,7 @@ namespace Discord.Commands var reader = Module.Service.GetTypeReader(type); if (reader == null) - throw new InvalidOperationException($"This type ({type.FullName}) is not supported."); + throw new InvalidOperationException($"{type.FullName} is not supported as a command parameter, are you missing a TypeReader?"); bool isUnparsed = parameter.GetCustomAttribute() != null; if (isUnparsed) @@ -103,6 +103,9 @@ namespace Discord.Commands } private Func, Task> BuildAction(MethodInfo methodInfo) { + if (methodInfo.ReturnType != typeof(Task)) + throw new InvalidOperationException("Commands must return a non-generic Task."); + //TODO: Temporary reflection hack. Lets build an actual expression tree here. return (msg, args) => {