Helpful error, forgot random.
This commit is contained in:
parent
861a587212
commit
7a95e14eae
@ -377,7 +377,27 @@ namespace NadekoBot.Modules {
|
|||||||
}
|
}
|
||||||
await e.Send(await usr.AvatarUrl.ShortenUrl());
|
await e.Send(await usr.AvatarUrl.ShortenUrl());
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
|
string saved = "";
|
||||||
|
cgb.CreateCommand("save")
|
||||||
|
.Description("Saves up to 5 last messages as a quote")
|
||||||
|
.Parameter("number", ParameterType.Required)
|
||||||
|
.Do(e => {
|
||||||
|
var arg = e.GetArg("number");
|
||||||
|
int num;
|
||||||
|
if (!int.TryParse(arg, out num) || num < 1 || num > 5)
|
||||||
|
num = 1;
|
||||||
|
saved = string.Join("\n", e.Channel.Messages.Skip(1).Take(num));
|
||||||
|
});
|
||||||
|
|
||||||
|
cgb.CreateCommand("quote")
|
||||||
|
.Description("Shows the previously saved quote")
|
||||||
|
.Parameter("arg", ParameterType.Required)
|
||||||
|
.Do(async e => {
|
||||||
|
var arg = e.GetArg("arg");
|
||||||
|
await e.Send("```"+saved+"```");
|
||||||
|
});
|
||||||
|
*/
|
||||||
//TODO add eval
|
//TODO add eval
|
||||||
/*
|
/*
|
||||||
cgb.CreateCommand(">")
|
cgb.CreateCommand(">")
|
||||||
|
@ -148,7 +148,10 @@ namespace NadekoBot.Modules {
|
|||||||
.Parameter("name", ParameterType.Unparsed)
|
.Parameter("name", ParameterType.Unparsed)
|
||||||
.Do(async e => {
|
.Do(async e => {
|
||||||
var arg = e.GetArg("name");
|
var arg = e.GetArg("name");
|
||||||
if (string.IsNullOrWhiteSpace(arg)) return;
|
if (string.IsNullOrWhiteSpace(arg)) {
|
||||||
|
await e.Send(":anger: Please enter a card name to search for.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
var res = await GetResponseAsync($"https://omgvamp-hearthstone-v1.p.mashape.com/cards/search/{Uri.EscapeUriString(arg)}",
|
var res = await GetResponseAsync($"https://omgvamp-hearthstone-v1.p.mashape.com/cards/search/{Uri.EscapeUriString(arg)}",
|
||||||
new Tuple<string, string>[] {
|
new Tuple<string, string>[] {
|
||||||
new Tuple<string, string>("X-Mashape-Key", NadekoBot.creds.MashapeKey),
|
new Tuple<string, string>("X-Mashape-Key", NadekoBot.creds.MashapeKey),
|
||||||
@ -159,6 +162,7 @@ namespace NadekoBot.Modules {
|
|||||||
if (items == null)
|
if (items == null)
|
||||||
throw new KeyNotFoundException("Cannot find a card by that name");
|
throw new KeyNotFoundException("Cannot find a card by that name");
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
items.Shuffle();
|
||||||
foreach (var item in items) {
|
foreach (var item in items) {
|
||||||
if (cnt >= 4)
|
if (cnt >= 4)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user