mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Fix avatar setting by mention
This commit is contained in:
parent
b85c79c57b
commit
3d073df359
2 changed files with 16 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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 <avatar url>")]
|
||||
[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 <avatar url>")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue