added ~google to get google search link #402
This commit is contained in:
parent
6f853938b5
commit
44ce541abc
@ -15,6 +15,7 @@ using System.Drawing;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
namespace NadekoBot.Modules.Searches
|
namespace NadekoBot.Modules.Searches
|
||||||
{
|
{
|
||||||
@ -219,6 +220,18 @@ $@"🌍 **Weather for** 【{obj["target"]}】
|
|||||||
.ConfigureAwait(false);
|
.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")
|
cgb.CreateCommand(Prefix + "hs")
|
||||||
.Description("Searches for a Hearthstone card and shows its image. Takes a while to complete. |~hs Ysera")
|
.Description("Searches for a Hearthstone card and shows its image. Takes a while to complete. |~hs Ysera")
|
||||||
.Parameter("name", ParameterType.Unparsed)
|
.Parameter("name", ParameterType.Unparsed)
|
||||||
|
@ -7,7 +7,7 @@ namespace NadekoBot.Classes.JSONModels
|
|||||||
public class Credentials
|
public class Credentials
|
||||||
{
|
{
|
||||||
public string Token { get; set; } = "";
|
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 BotId { get; set; } = 1231231231231;
|
||||||
public ulong[] OwnerIds { get; set; } = { 123123123123, 5675675679845 };
|
public ulong[] OwnerIds { get; set; } = { 123123123123, 5675675679845 };
|
||||||
public string GoogleAPIKey { get; set; } = "";
|
public string GoogleAPIKey { get; set; } = "";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Token": "",
|
"Token": "",
|
||||||
"ClientId": "116275390695079945",
|
"ClientId": "170254782546575360",
|
||||||
"BotId": 1231231231231,
|
"BotId": 1231231231231,
|
||||||
"OwnerIds": [
|
"OwnerIds": [
|
||||||
123123123123,
|
123123123123,
|
||||||
|
Loading…
Reference in New Issue
Block a user