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)

View File

@ -7,7 +7,7 @@ namespace NadekoBot.Classes.JSONModels
public class Credentials
{
public string Token { get; set; } = "";
public string ClientId { get; set; } = "116275390695079945";
public string ClientId { get; set; } = "170254782546575360";
public ulong BotId { get; set; } = 1231231231231;
public ulong[] OwnerIds { get; set; } = { 123123123123, 5675675679845 };
public string GoogleAPIKey { get; set; } = "";

View File

@ -1,6 +1,6 @@
{
"Token": "",
"ClientId": "116275390695079945",
"ClientId": "170254782546575360",
"BotId": 1231231231231,
"OwnerIds": [
123123123123,