mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 09:10:14 +00:00
Skip flag parsing when handling proxy tags
This commit is contained in:
parent
de141d629b
commit
493f7b12e5
3 changed files with 14 additions and 12 deletions
|
|
@ -101,15 +101,18 @@ namespace PluralKit.Bot
|
|||
return _flags;
|
||||
}
|
||||
|
||||
public string Remainder()
|
||||
public string Remainder(bool skipFlags = true)
|
||||
{
|
||||
// Skip all *leading* flags when taking the remainder
|
||||
while (NextWordPosition(_ptr) is {} wp)
|
||||
if (skipFlags)
|
||||
{
|
||||
if (_cmd[wp.startPos] != '-' || wp.wasQuoted) break;
|
||||
_ptr = wp.endPos + wp.advanceAfterWord;
|
||||
// Skip all *leading* flags when taking the remainder
|
||||
while (NextWordPosition(_ptr) is {} wp)
|
||||
{
|
||||
if (_cmd[wp.startPos] != '-' || wp.wasQuoted) break;
|
||||
_ptr = wp.endPos + wp.advanceAfterWord;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// *Then* get the remainder
|
||||
return _cmd.Substring(Math.Min(_ptr, _cmd.Length)).Trim();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue