mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 23:07:54 +00:00
feat(bot): add -plaintext flag alongside -raw
This commit is contained in:
parent
3d9be096cb
commit
23fe904464
5 changed files with 322 additions and 162 deletions
|
|
@ -91,8 +91,12 @@ public static class ContextArgumentsExt
|
|||
public static bool MatchClear(this Context ctx)
|
||||
=> ctx.Match("clear", "reset", "default") || ctx.MatchFlag("c", "clear");
|
||||
|
||||
public static bool MatchRaw(this Context ctx) =>
|
||||
ctx.Match("r", "raw") || ctx.MatchFlag("r", "raw");
|
||||
public static ReplyFormat MatchFormat(this Context ctx)
|
||||
{
|
||||
if (ctx.Match("r", "raw") || ctx.MatchFlag("r", "raw")) return ReplyFormat.Raw;
|
||||
if (ctx.Match("pt", "plaintext") || ctx.MatchFlag("pt", "plaintext")) return ReplyFormat.Plaintext;
|
||||
return ReplyFormat.Standard;
|
||||
}
|
||||
|
||||
public static bool MatchToggle(this Context ctx, bool? defaultValue = null)
|
||||
{
|
||||
|
|
@ -184,4 +188,11 @@ public static class ContextArgumentsExt
|
|||
|
||||
return groups;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ReplyFormat
|
||||
{
|
||||
Standard,
|
||||
Raw,
|
||||
Plaintext
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue