Add group privacy command/structures

This commit is contained in:
Ske
2020-07-18 13:53:02 +02:00
parent 47d5ad0004
commit 5e28e0aba1
6 changed files with 163 additions and 6 deletions

View File

@@ -35,5 +35,14 @@ namespace PluralKit.Bot
ctx.PopArgument();
return subject;
}
public static GroupPrivacySubject PopGroupPrivacySubject(this Context ctx)
{
if (!GroupPrivacyUtils.TryParseGroupPrivacy(ctx.PeekArgument(), out var subject))
throw new PKSyntaxError($"Invalid privacy subject `{ctx.PopArgument()}` (must be `description`, `icon`, `visibility`, or `all).");
ctx.PopArgument();
return subject;
}
}
}