diff --git a/PluralKit.Bot/Commands/MemberCommands.cs b/PluralKit.Bot/Commands/MemberCommands.cs index 444a0a4a..03874d80 100644 --- a/PluralKit.Bot/Commands/MemberCommands.cs +++ b/PluralKit.Bot/Commands/MemberCommands.cs @@ -191,6 +191,7 @@ namespace PluralKit.Bot.Commands { if (member.AvatarId == null) throw Errors.UserHasNoAvatar; ContextEntity.AvatarUrl = member.GetAvatarUrl(ImageFormat.Png, size: 256); + await Members.Save(ContextEntity); var embed = new EmbedBuilder().WithImageUrl(ContextEntity.AvatarUrl).Build(); await Context.Channel.SendMessageAsync( diff --git a/PluralKit.Bot/Commands/SystemCommands.cs b/PluralKit.Bot/Commands/SystemCommands.cs index 0ab7ec1b..f7c3720d 100644 --- a/PluralKit.Bot/Commands/SystemCommands.cs +++ b/PluralKit.Bot/Commands/SystemCommands.cs @@ -95,6 +95,21 @@ namespace PluralKit.Bot.Commands await Context.Channel.SendMessageAsync($"{Emojis.Success} System tag {(newTag != null ? "changed" : "cleared")}."); } + [Command("avatar")] + [Alias("profile", "picture", "icon", "image", "pic", "pfp")] + [Remarks("system avatar ")] + [MustHaveSystem] + public async Task SystemAvatar(IUser member) + { + if (member.AvatarId == null) throw Errors.UserHasNoAvatar; + Context.SenderSystem.AvatarUrl = member.GetAvatarUrl(ImageFormat.Png, size: 256); + await Systems.Save(Context.SenderSystem); + + var embed = new EmbedBuilder().WithImageUrl(Context.SenderSystem.AvatarUrl).Build(); + await Context.Channel.SendMessageAsync( + $"{Emojis.Success} System avatar changed to {member.Username}'s avatar! {Emojis.Warn} Please note that if {member.Username} changes their avatar, the system's avatar will need to be re-set.", embed: embed); + } + [Command("avatar")] [Alias("profile", "picture", "icon", "image", "pic", "pfp")] [Remarks("system avatar ")]