~boobs ~i and ~ir implemented :D
This commit is contained in:
parent
3244c3d6ba
commit
4e66f7eac0
@ -84,21 +84,33 @@ namespace NadekoBot.Modules {
|
|||||||
});
|
});
|
||||||
|
|
||||||
cgb.CreateCommand("~i")
|
cgb.CreateCommand("~i")
|
||||||
.Description("Pulls a first image using a search parameter.\n**Usage**: @NadekoBot img Multiword_search_parameter")
|
.Description("Pulls a first image using a search parameter. Use ~ir for different results.\n**Usage**: ~i cute kitten")
|
||||||
.Alias("img")
|
.Parameter("query", ParameterType.Unparsed)
|
||||||
.Parameter("all", ParameterType.Unparsed)
|
|
||||||
.Do(async e => {
|
.Do(async e => {
|
||||||
await e.Send("This feature is being reconstructed.");
|
if (string.IsNullOrWhiteSpace(e.GetArg("query")))
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
var reqString = $"https://www.googleapis.com/customsearch/v1?q={Uri.EscapeDataString(e.GetArg("query"))}&cx=018084019232060951019%3Ahs5piey28-e&num=1&searchType=image&fields=items%2Flink&key={NadekoBot.creds.GoogleAPIKey}";
|
||||||
|
var obj = JObject.Parse(await GetResponseAsync(reqString));
|
||||||
|
await e.Send(obj["items"][0]["link"].ToString());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
await e.Send($":anger: {ex.Message}");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
cgb.CreateCommand("~ir")
|
cgb.CreateCommand("~ir")
|
||||||
.Description("Pulls a random image using a search parameter.\n**Usage**: @NadekoBot img Multiword_search_parameter")
|
.Description("Pulls a random image using a search parameter.\n**Usage**: ~ir cute kitten")
|
||||||
.Alias("imgrandom")
|
.Parameter("query", ParameterType.Unparsed)
|
||||||
.Parameter("all", ParameterType.Unparsed)
|
|
||||||
.Do(async e => {
|
.Do(async e => {
|
||||||
await e.Send("This feature is being reconstructed.");
|
if (string.IsNullOrWhiteSpace(e.GetArg("query")))
|
||||||
|
return;
|
||||||
|
try {
|
||||||
|
var reqString = $"https://www.googleapis.com/customsearch/v1?q={Uri.EscapeDataString(e.GetArg("query"))}&cx=018084019232060951019%3Ahs5piey28-e&num=1&searchType=image&start={ _r.Next(1, 150) }&fields=items%2Flink&key={NadekoBot.creds.GoogleAPIKey}";
|
||||||
|
var obj = JObject.Parse(await GetResponseAsync(reqString));
|
||||||
|
await e.Send(obj["items"][0]["link"].ToString());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
await e.Send($":anger: {ex.Message}");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
cgb.CreateCommand("~hentai")
|
cgb.CreateCommand("~hentai")
|
||||||
@ -135,6 +147,16 @@ namespace NadekoBot.Modules {
|
|||||||
.Do(async e => {
|
.Do(async e => {
|
||||||
await e.Send("http://i.imgur.com/MZkY1md.jpg");
|
await e.Send("http://i.imgur.com/MZkY1md.jpg");
|
||||||
});
|
});
|
||||||
|
cgb.CreateCommand("~boobs")
|
||||||
|
.Description("Real adult content.")
|
||||||
|
.Do(async e => {
|
||||||
|
try {
|
||||||
|
var obj = JArray.Parse(await GetResponseAsync($"http://api.oboobs.ru/boobs/{_r.Next(0, 9304)}"))[0];
|
||||||
|
await e.Send($"http://media.oboobs.ru/{ obj["preview"].ToString() }");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
await e.Send($":anger: {ex.Message}");
|
||||||
|
}
|
||||||
|
});
|
||||||
cgb.CreateCommand("lmgtfy")
|
cgb.CreateCommand("lmgtfy")
|
||||||
.Alias("~lmgtfy")
|
.Alias("~lmgtfy")
|
||||||
.Description("Google something for an idiot.")
|
.Description("Google something for an idiot.")
|
||||||
|
Loading…
Reference in New Issue
Block a user