From c50e192dbe33be016d528a2c3b33f6ea1bbf41c8 Mon Sep 17 00:00:00 2001 From: fkndean Date: Sun, 27 Nov 2016 20:19:12 -0500 Subject: [PATCH] whoops accidentally removed Google. --- src/NadekoBot/Modules/Searches/Searches.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/NadekoBot/Modules/Searches/Searches.cs b/src/NadekoBot/Modules/Searches/Searches.cs index 14bcc5bf..82bf2ece 100644 --- a/src/NadekoBot/Modules/Searches/Searches.cs +++ b/src/NadekoBot/Modules/Searches/Searches.cs @@ -194,6 +194,20 @@ $@"🌍 **Weather for** 【{obj["target"]}】 await msg.Channel.SendMessageAsync(await NadekoBot.Google.ShortenUrl(arg).ConfigureAwait(false)); } + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task Google(IUserMessage umsg, [Remainder] string terms = null) + { + var channel = (ITextChannel)umsg.Channel; + + + terms = terms?.Trim(); + if (string.IsNullOrWhiteSpace(terms)) + return; + await channel.SendMessageAsync($"https://google.com/search?q={ WebUtility.UrlEncode(terms).Replace(' ', '+') }") + .ConfigureAwait(false); + } + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] public async Task MagicTheGathering(IUserMessage umsg, [Remainder] string name = null)