Fixed gif avatars

This commit is contained in:
Kwoth 2016-12-29 05:29:36 +01:00
parent 8788b284bf
commit b215710915
2 changed files with 8 additions and 8 deletions

@ -1 +1 @@
Subproject commit 508026d5d4f4d8780d983c63ab25e4c15ad69e59 Subproject commit ae614b68b336941bf780b5f3c74bf7f6ea505316

View File

@ -663,17 +663,17 @@ namespace NadekoBot.Modules.Searches
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
public async Task Avatar(IUserMessage umsg, [Remainder] string mention = null) public async Task Avatar(IUserMessage umsg, [Remainder] IUser usr = null)
{ {
var channel = (ITextChannel)umsg.Channel; var channel = (ITextChannel)umsg.Channel;
var usr = umsg.MentionedUsers.FirstOrDefault();
if (usr == null) if (usr == null)
{ usr = umsg.Author;
await channel.SendErrorAsync("Invalid user specified.").ConfigureAwait(false);
return; await channel.EmbedAsync(new EmbedBuilder().WithOkColor()
} .WithTitle($"{usr}'s Avatar")
await channel.SendMessageAsync(await NadekoBot.Google.ShortenUrl(usr.AvatarUrl).ConfigureAwait(false)).ConfigureAwait(false); .WithImageUrl(usr.AvatarUrl)
.Build()).ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]