From ff017bd51f886d7e7d60ac5b7cf5057fcf0464d3 Mon Sep 17 00:00:00 2001 From: RogueException Date: Thu, 28 Jul 2016 23:20:36 -0300 Subject: [PATCH] Remove string check for unparsed --- src/Discord.Net.Commands/Command.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Discord.Net.Commands/Command.cs b/src/Discord.Net.Commands/Command.cs index 909765e93..9b8ed98e1 100644 --- a/src/Discord.Net.Commands/Command.cs +++ b/src/Discord.Net.Commands/Command.cs @@ -88,13 +88,8 @@ namespace Discord.Commands throw new InvalidOperationException($"{type.FullName} is not supported as a command parameter, are you missing a TypeReader?"); bool isUnparsed = parameter.GetCustomAttribute() != null; - if (isUnparsed) - { - if (type != typeof(string)) - throw new InvalidOperationException("Unparsed parameters only support the string type."); - else if (i != parameters.Length - 1) - throw new InvalidOperationException("Unparsed parameters must be the last parameter in a command."); - } + if (isUnparsed && i != parameters.Length - 1) + throw new InvalidOperationException("Unparsed parameters must be the last parameter in a command."); string name = parameter.Name; string description = typeInfo.GetCustomAttribute()?.Text;