mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 22:37:54 +00:00
feat: add raw and plaintext formats to member avatar, proxy avatar, and guild avatar
This commit is contained in:
parent
2d17582e05
commit
2c4dea29be
3 changed files with 35 additions and 6 deletions
|
|
@ -98,6 +98,15 @@ public static class ContextArgumentsExt
|
|||
return ReplyFormat.Standard;
|
||||
}
|
||||
|
||||
public static ReplyFormat PeekMatchFormat(this Context ctx)
|
||||
{
|
||||
int ptr1 = ctx.Parameters._ptr;
|
||||
int ptr2 = ctx.Parameters._ptr;
|
||||
if (ctx.PeekMatch(ref ptr1, new[] { "r", "raw" }) || ctx.MatchFlag("r", "raw")) return ReplyFormat.Raw;
|
||||
if (ctx.PeekMatch(ref ptr2, new[] { "pt", "plaintext" }) || ctx.MatchFlag("pt", "plaintext")) return ReplyFormat.Plaintext;
|
||||
return ReplyFormat.Standard;
|
||||
}
|
||||
|
||||
public static bool MatchToggle(this Context ctx, bool? defaultValue = null)
|
||||
{
|
||||
var value = ctx.MatchToggleOrNull(defaultValue);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue