feat(webhooks): add basic commands

This commit is contained in:
spiral
2021-11-03 02:01:35 -04:00
parent c1f05eecf8
commit a81ffc3399
4 changed files with 64 additions and 3 deletions

View File

@@ -16,6 +16,12 @@ namespace PluralKit.Bot
throw new PKError("This command can not be run in a DM.");
}
public static Context CheckDMContext(this Context ctx)
{
if (ctx.Channel.GuildId == null) return ctx;
throw new PKError("This command must be run in a DM.");
}
public static Context CheckSystemPrivacy(this Context ctx, PKSystem target, PrivacyLevel level)
{
if (level.CanAccess(ctx.LookupContextFor(target))) return ctx;