From 8991bad44783570566ac0ec850cf45a8037b5867 Mon Sep 17 00:00:00 2001 From: RogueException Date: Thu, 29 Oct 2015 23:35:16 -0300 Subject: [PATCH] Fixed crash for having multiple optional parameters --- src/Discord.Net.Commands/CommandBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net.Commands/CommandBuilder.cs b/src/Discord.Net.Commands/CommandBuilder.cs index 981bc23df..a97ff8d73 100644 --- a/src/Discord.Net.Commands/CommandBuilder.cs +++ b/src/Discord.Net.Commands/CommandBuilder.cs @@ -36,7 +36,7 @@ namespace Discord.Commands { if (_hasCatchAll) throw new Exception("No parameters may be added after the catch-all"); - if (_hasOptional && isOptional) + if (_hasOptional && !isOptional) throw new Exception("Non-optional parameters may not be added after an optional one"); _params.Add(new CommandParameter(name, isOptional, isCatchAll));