Browse Source

Fixed crash for having multiple optional parameters

tags/docs-0.9
RogueException 9 years ago
parent
commit
8991bad447
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Commands/CommandBuilder.cs

+ 1
- 1
src/Discord.Net.Commands/CommandBuilder.cs View File

@@ -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));


Loading…
Cancel
Save