From 99c5c2e92fcfe6763e8a2876967d0a26da22f28c Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Wed, 27 Apr 2016 22:42:28 +0200 Subject: [PATCH] `.revimg` to reverse image search any link --- NadekoBot.sln | 2 +- NadekoBot/Modules/Searches/SearchesModule.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NadekoBot.sln b/NadekoBot.sln index 5e8a3b96..e7681a7d 100644 --- a/NadekoBot.sln +++ b/NadekoBot.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25008.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NadekoBot", "NadekoBot\NadekoBot.csproj", "{27A886F5-CDDA-4F4A-81EE-6DAFCCE9DE46}" EndProject diff --git a/NadekoBot/Modules/Searches/SearchesModule.cs b/NadekoBot/Modules/Searches/SearchesModule.cs index 4f7a3fb4..2c707255 100644 --- a/NadekoBot/Modules/Searches/SearchesModule.cs +++ b/NadekoBot/Modules/Searches/SearchesModule.cs @@ -409,6 +409,18 @@ $@"🌍 **Weather for** 【{obj["target"]}】 return; await e.Channel.SendMessage($"https://images.google.com/searchbyimage?image_url={usr.AvatarUrl}").ConfigureAwait(false); }); + + cgb.CreateCommand(Prefix + "revimg") + .Description("Returns a google reverse image search for an image from a link.") + .Parameter("image", ParameterType.Unparsed) + .Do(async e => + { + var imgLink = e.GetArg("image")?.Trim(); + + if (string.IsNullOrWhiteSpace(imgLink)) + return; + await e.Channel.SendMessage($"https://images.google.com/searchbyimage?image_url={imgLink}").ConfigureAwait(false); + }); }); } }