From d2698f84cac903615bffdb1de221771f7d71cc90 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sat, 19 Mar 2016 03:50:51 +0100 Subject: [PATCH] fixes to docs, weather added --- NadekoBot/Modules/ClashOfClans.cs | 6 +++--- NadekoBot/Modules/Games.cs | 2 +- NadekoBot/Modules/Searches.cs | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/NadekoBot/Modules/ClashOfClans.cs b/NadekoBot/Modules/ClashOfClans.cs index 888826f4..17264553 100644 --- a/NadekoBot/Modules/ClashOfClans.cs +++ b/NadekoBot/Modules/ClashOfClans.cs @@ -123,7 +123,7 @@ namespace NadekoBot.Commands { cgb.CreateCommand(Prefix + "claim") .Alias(Prefix + "call") .Alias(Prefix + "c") - .Description($"Claims a certain base from a certain war. You can supply a name in the third optional argument to claim in someone else's place. \n**Usage**: {Prefix}call [war_number] [base_number] (optional_otheruser)") + .Description($"Claims a certain base from a certain war. You can supply a name in the third optional argument to claim in someone else's place. \n**Usage**: {Prefix}call [war_number] [base_number] [optional_other_name]") .Parameter("number") .Parameter("baseNumber") .Parameter("other_name", ParameterType.Unparsed) @@ -153,7 +153,7 @@ namespace NadekoBot.Commands { cgb.CreateCommand(Prefix + "cf") .Alias(Prefix + "claimfinish") - .Description($"Finish your claim if you destroyed a base. Optional second argument finishes for someone else.\n**Usage**: {Prefix}cf [war_number] (optional_other_name)") + .Description($"Finish your claim if you destroyed a base. Optional second argument finishes for someone else.\n**Usage**: {Prefix}cf [war_number] [optional_other_name]") .Parameter("number", ParameterType.Required) .Parameter("other_name", ParameterType.Unparsed) .Do(async e => { @@ -179,7 +179,7 @@ namespace NadekoBot.Commands { cgb.CreateCommand(Prefix + "unclaim") .Alias(Prefix + "uncall") .Alias(Prefix + "uc") - .Description($"Removes your claim from a certain war. Optional second argument denotes a person in whos place to unclaim\n**Usage**: {Prefix}uc [war_number] (optional_other_name)") + .Description($"Removes your claim from a certain war. Optional second argument denotes a person in whos place to unclaim\n**Usage**: {Prefix}uc [war_number] [optional_other_name]") .Parameter("number", ParameterType.Required) .Parameter("other_name", ParameterType.Unparsed) .Do(async e => { diff --git a/NadekoBot/Modules/Games.cs b/NadekoBot/Modules/Games.cs index bb229bf5..3dd8d46f 100644 --- a/NadekoBot/Modules/Games.cs +++ b/NadekoBot/Modules/Games.cs @@ -54,7 +54,7 @@ namespace NadekoBot.Modules { }); cgb.CreateCommand(Prefix + "attack") - .Description("Attack a person. Supported attacks: 'splash', 'strike', 'burn', 'surge'.\n**Usage**: > strike @User") + .Description("Attack a person. Supported attacks: 'splash', 'strike', 'burn', 'surge'.\n**Usage**: >attack strike @User") .Parameter("attack_type", Discord.Commands.ParameterType.Required) .Parameter("target", Discord.Commands.ParameterType.Required) .Do(async e => { diff --git a/NadekoBot/Modules/Searches.cs b/NadekoBot/Modules/Searches.cs index 5e040e12..705c9cda 100644 --- a/NadekoBot/Modules/Searches.cs +++ b/NadekoBot/Modules/Searches.cs @@ -29,6 +29,24 @@ namespace NadekoBot.Modules { commands.ForEach(cmd => cmd.Init(cgb)); + cgb.CreateCommand(Prefix + "we") + .Description("Shows weather data for a specified city and a country BOTH ARE REQUIRED. Weather api is very random if you make a mistake.") + .Parameter("city", ParameterType.Required) + .Parameter("country", ParameterType.Required) + .Do(async e => { + var city = e.GetArg("city").Replace(" ", ""); + var country = e.GetArg("country").Replace(" ", ""); + var response = await SearchHelper.GetResponseStringAsync($"http://api.lawlypopzz.xyz/nadekobot/weather/?city={city}&country={country}"); + + var obj = JObject.Parse(response)["weather"]; + + await e.Channel.SendMessage( +$@"**`Location:`【{obj["target"]}】 +`Temp:` {obj["centigrade"]}°C, {obj["condition"]} `Feels like:` {obj["feelscentigrade"]}°C +`Wind:` {obj["windspeedk"]}km/h {obj["winddir"]} `Humidity:` {obj["humidity"]}%**"); + }); + + cgb.CreateCommand(Prefix + "yt") .Parameter("query", ParameterType.Unparsed) .Description("Searches youtubes and shows the first result")