Fixed ~revav

This commit is contained in:
Kwoth 2016-10-19 12:59:17 +02:00
parent 13bac49acc
commit 7d4db46fe7

View File

@ -335,18 +335,12 @@ $@"🌍 **Weather for** 【{obj["target"]}】
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task Revav(IUserMessage umsg, [Remainder] string arg = null)
public async Task Revav(IUserMessage umsg, [Remainder] IUser usr = null)
{
var channel = (ITextChannel)umsg.Channel;
var usrStr = arg?.Trim().ToUpperInvariant();
if (string.IsNullOrWhiteSpace(usrStr))
return;
var usr = channel.Guild.GetUsers().Where(u => u.Username.ToUpperInvariant() == usrStr).FirstOrDefault();
if (usr == null || string.IsNullOrWhiteSpace(usr.AvatarUrl))
return;
if (usr == null)
usr = umsg.Author;
await channel.SendMessageAsync($"https://images.google.com/searchbyimage?image_url={usr.AvatarUrl}").ConfigureAwait(false);
}