Browse Source

Fix parsing of multiple quoted parameters

This should Fix #262
tags/1.0-rc
Davipb 8 years ago
parent
commit
b0286975cd
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      src/Discord.Net.Commands/CommandParser.cs

+ 4
- 6
src/Discord.Net.Commands/CommandParser.cs View File

@@ -65,7 +65,9 @@ namespace Discord.Commands
return ParseResult.FromError(CommandError.ParseFailed, "There must be at least one character of whitespace between arguments.");
else
{
curParam = command.Parameters.Count > argList.Count ? command.Parameters[argList.Count] : null;
if (curParam == null)
curParam = command.Parameters.Count > argList.Count ? command.Parameters[argList.Count] : null;

if (curParam != null && curParam.IsRemainder)
{
argBuilder.Append(c);
@@ -116,11 +118,7 @@ namespace Discord.Commands
{
paramList.Add(typeReaderResult);

if (curPos == endPos)
{
curParam = null;
curPart = ParserPart.None;
}
curPart = ParserPart.None;
}
else
{


Loading…
Cancel
Save