fixes to docs, weather added

This commit is contained in:
Master Kwoth 2016-03-19 03:50:51 +01:00
parent 17a9193eb3
commit d2698f84ca
3 changed files with 22 additions and 4 deletions

View File

@ -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 => {

View File

@ -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 => {

View File

@ -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")