Merge branch 'feat/webhooks' into main

This commit is contained in:
spiral 2021-11-25 17:15:42 -05:00
commit b8e2ebd470
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
34 changed files with 920 additions and 39 deletions

View file

@ -18,6 +18,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;