mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Allow setting member avatar by mention
This commit is contained in:
parent
e0a93ba608
commit
003f64abbd
2 changed files with 15 additions and 0 deletions
|
|
@ -186,6 +186,20 @@ namespace PluralKit.Bot.Commands
|
|||
await Context.Channel.SendMessageAsync($"{Emojis.Success} Member deleted.");
|
||||
}
|
||||
|
||||
[Command("avatar")]
|
||||
[Alias("profile", "picture", "icon", "image", "pic", "pfp")]
|
||||
[Remarks("member <member> avatar <avatar url>")]
|
||||
[MustPassOwnMember]
|
||||
public async Task MemberAvatarByMention(IUser member)
|
||||
{
|
||||
if (member.AvatarId == null) throw Errors.UserHasNoAvatar;
|
||||
ContextEntity.AvatarUrl = member.GetAvatarUrl(ImageFormat.Png, size: 256);
|
||||
|
||||
var embed = new EmbedBuilder().WithImageUrl(ContextEntity.AvatarUrl).Build();
|
||||
await Context.Channel.SendMessageAsync(
|
||||
$"{Emojis.Success} Member avatar changed to {member.Username}'s avatar! {Emojis.Warn} Please note that if {member.Username} changes their avatar, the webhook's avatar will need to be re-set.", embed: embed);
|
||||
}
|
||||
|
||||
[Command("avatar")]
|
||||
[Alias("profile", "picture", "icon", "image", "pic", "pfp")]
|
||||
[Remarks("member <member> avatar <avatar url>")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue