added weather example, fixed some descriptions, forgot to close #231
This commit is contained in:
parent
5abd1e8800
commit
a7e2771fcc
@ -1,6 +1,7 @@
|
|||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using NadekoBot.Extensions;
|
using NadekoBot.Extensions;
|
||||||
using NadekoBot.Modules;
|
using NadekoBot.Modules;
|
||||||
|
using NadekoBot.Modules.Permissions.Classes;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
@ -79,11 +80,10 @@ namespace NadekoBot.Classes.Conversations.Commands
|
|||||||
});
|
});
|
||||||
|
|
||||||
cgb.CreateCommand("dr")
|
cgb.CreateCommand("dr")
|
||||||
.Description("Deletes a request. Only owner is able to do this.")
|
.Description("Deletes a request. **Owner Only!**")
|
||||||
.Parameter("reqNumber", ParameterType.Required)
|
.Parameter("reqNumber", ParameterType.Required)
|
||||||
|
.AddCheck(SimpleCheckers.OwnerOnly())
|
||||||
.Do(async e =>
|
.Do(async e =>
|
||||||
{
|
|
||||||
if (NadekoBot.IsOwner(e.User.Id))
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -100,16 +100,13 @@ namespace NadekoBot.Classes.Conversations.Commands
|
|||||||
{
|
{
|
||||||
await e.Channel.SendMessage("Error deleting request, probably NaN error.").ConfigureAwait(false);
|
await e.Channel.SendMessage("Error deleting request, probably NaN error.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else await e.Channel.SendMessage("You don't have permission to do that.").ConfigureAwait(false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
cgb.CreateCommand("rr")
|
cgb.CreateCommand("rr")
|
||||||
.Description("Resolves a request. Only owner is able to do this.")
|
.Description("Resolves a request. **Owner Only!**")
|
||||||
.Parameter("reqNumber", ParameterType.Required)
|
.Parameter("reqNumber", ParameterType.Required)
|
||||||
|
.AddCheck(SimpleCheckers.OwnerOnly())
|
||||||
.Do(async e =>
|
.Do(async e =>
|
||||||
{
|
|
||||||
if (NadekoBot.IsOwner(e.User.Id))
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -128,8 +125,6 @@ namespace NadekoBot.Classes.Conversations.Commands
|
|||||||
{
|
{
|
||||||
await e.Channel.SendMessage("Error resolving request, probably NaN error.").ConfigureAwait(false);
|
await e.Channel.SendMessage("Error resolving request, probably NaN error.").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else await e.Channel.SendMessage("You don't have permission to do that.").ConfigureAwait(false);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
commands.ForEach(cmd => cmd.Init(cgb));
|
commands.ForEach(cmd => cmd.Init(cgb));
|
||||||
|
|
||||||
cgb.CreateCommand(Prefix + "we")
|
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.")
|
.Description($"Shows weather data for a specified city and a country. BOTH ARE REQUIRED. Use country abbrevations.\n**Usage**: {Prefix}we Moscow RF")
|
||||||
.Parameter("city", ParameterType.Required)
|
.Parameter("city", ParameterType.Required)
|
||||||
.Parameter("country", ParameterType.Required)
|
.Parameter("country", ParameterType.Required)
|
||||||
.Do(async e =>
|
.Do(async e =>
|
||||||
@ -160,13 +160,13 @@ $@"🌍 **Weather for** 【{obj["target"]}】
|
|||||||
}
|
}
|
||||||
catch (HttpRequestException exception)
|
catch (HttpRequestException exception)
|
||||||
{
|
{
|
||||||
if (exception.Message.Contains ("403 (Forbidden)"))
|
if (exception.Message.Contains("403 (Forbidden)"))
|
||||||
{
|
{
|
||||||
await e.Channel.SendMessage ("Daily limit reached!");
|
await e.Channel.SendMessage("Daily limit reached!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await e.Channel.SendMessage ("Something went wrong.");
|
await e.Channel.SendMessage("Something went wrong.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -186,13 +186,13 @@ $@"🌍 **Weather for** 【{obj["target"]}】
|
|||||||
}
|
}
|
||||||
catch (HttpRequestException exception)
|
catch (HttpRequestException exception)
|
||||||
{
|
{
|
||||||
if (exception.Message.Contains ("403 (Forbidden)"))
|
if (exception.Message.Contains("403 (Forbidden)"))
|
||||||
{
|
{
|
||||||
await e.Channel.SendMessage ("Daily limit reached!");
|
await e.Channel.SendMessage("Daily limit reached!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await e.Channel.SendMessage ("Something went wrong.");
|
await e.Channel.SendMessage("Something went wrong.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user