added ~google to get google search link #402

This commit is contained in:
Kwoth
2016-07-19 13:37:20 +02:00
parent 6f853938b5
commit 44ce541abc
3 changed files with 15 additions and 2 deletions

View File

@ -15,6 +15,7 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Web;
namespace NadekoBot.Modules.Searches
{
@ -219,6 +220,18 @@ $@"🌍 **Weather for** 【{obj["target"]}】
.ConfigureAwait(false);
});
cgb.CreateCommand(Prefix + "google")
.Description("Get a google search link for some terms.")
.Parameter("terms", ParameterType.Unparsed)
.Do(async e =>
{
var terms = e.GetArg("terms")?.Trim().Replace(' ', '+');
if (string.IsNullOrWhiteSpace(terms))
return;
await e.Channel.SendMessage($"https://google.com/search?q={ HttpUtility.UrlEncode(terms) }")
.ConfigureAwait(false);
});
cgb.CreateCommand(Prefix + "hs")
.Description("Searches for a Hearthstone card and shows its image. Takes a while to complete. |~hs Ysera")
.Parameter("name", ParameterType.Unparsed)