added ~google to get google search link #402
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user