From 0bb8d2b917e76caca875b3699de2be568841dba6 Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 13 Jun 2020 20:23:06 +0200 Subject: [PATCH] Add own member checks back to the avatar mutators --- PluralKit.Bot/Commands/MemberAvatar.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PluralKit.Bot/Commands/MemberAvatar.cs b/PluralKit.Bot/Commands/MemberAvatar.cs index 9be5e90f..bfdeb736 100644 --- a/PluralKit.Bot/Commands/MemberAvatar.cs +++ b/PluralKit.Bot/Commands/MemberAvatar.cs @@ -70,6 +70,7 @@ namespace PluralKit.Bot private async Task AvatarFromUser(AvatarLocation location, Context ctx, PKMember target, DiscordUser user) { + ctx.CheckSystem().CheckOwnMember(target); if (user.AvatarHash == null) throw Errors.UserHasNoAvatar; var url = user.GetAvatarUrl(ImageFormat.Png, 256); @@ -84,6 +85,7 @@ namespace PluralKit.Bot private async Task AvatarFromArg(AvatarLocation location, Context ctx, PKMember target, string url) { + ctx.CheckSystem().CheckOwnMember(target); if (url.Length > Limits.MaxUriLength) throw Errors.InvalidUrl(url); await AvatarUtils.VerifyAvatarOrThrow(url); @@ -96,6 +98,7 @@ namespace PluralKit.Bot private async Task AvatarFromAttachment(AvatarLocation location, Context ctx, PKMember target, DiscordAttachment attachment) { + ctx.CheckSystem().CheckOwnMember(target); await AvatarUtils.VerifyAvatarOrThrow(attachment.Url); await UpdateAvatar(location, ctx, target, attachment.Url); if (location == AvatarLocation.Server)