From 7d4db46fe7e1373fef683e53522b9e0997cae4a3 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 19 Oct 2016 12:59:17 +0200 Subject: [PATCH] Fixed ~revav --- src/NadekoBot/Modules/Searches/Searches.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 8118e011..9a370f80 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -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); }