mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
feat: pk;config
This commit is contained in:
parent
d195c80d92
commit
56d07e0f2d
41 changed files with 648 additions and 313 deletions
|
|
@ -48,6 +48,23 @@ public static class ContextArgumentsExt
|
|||
return ctx.Match(ref used, potentialMatches);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Matches the next *n* parameters against each parameter consecutively.
|
||||
/// <br />
|
||||
/// Note that this is handled differently than single-parameter Match:
|
||||
/// each method parameter is an array of potential matches for the *n*th command string parameter.
|
||||
/// </summary>
|
||||
public static bool MatchMultiple(this Context ctx, params string[][] potentialParametersMatches)
|
||||
{
|
||||
foreach (var param in potentialParametersMatches)
|
||||
if (!ctx.Match(param)) return false;
|
||||
|
||||
for (var i = 0; i < potentialParametersMatches.Length; i++)
|
||||
ctx.PopArgument();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool MatchFlag(this Context ctx, params string[] potentialMatches)
|
||||
{
|
||||
// Flags are *ALWAYS PARSED LOWERCASE*. This means we skip out on a "ToLower" call here.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue