From c2b2286fd68d3f33f3296306ac67bafcf6286caf Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Fri, 5 Nov 2021 20:31:33 +0100 Subject: [PATCH] Bonk --- commands/nsfw/4k.js | 30 ++++++++++++++++++ commands/nsfw/anal.js | 30 ++++++++++++++++++ commands/nsfw/ass.js | 30 ++++++++++++++++++ commands/nsfw/booru.js | 49 ++++++++++++++++++++++++++++++ commands/nsfw/danbooru.js | 26 ++++++++++++++++ commands/nsfw/gelbooru.js | 27 +++++++++++++++++ commands/nsfw/gonewild.js | 30 ++++++++++++++++++ commands/nsfw/hanal.js | 30 ++++++++++++++++++ commands/nsfw/hass.js | 30 ++++++++++++++++++ commands/nsfw/hentai.js | 30 ++++++++++++++++++ commands/nsfw/hkitsune.js | 30 ++++++++++++++++++ commands/nsfw/hthigh.js | 30 ++++++++++++++++++ commands/nsfw/hypnohub.js | 27 +++++++++++++++++ commands/nsfw/konachan-lewd.js | 28 +++++++++++++++++ commands/nsfw/konachan-safer.js | 26 ++++++++++++++++ commands/nsfw/nekos-lewd.js | 54 +++++++++++++++++++++++++++++++++ commands/nsfw/paizuri.js | 30 ++++++++++++++++++ commands/nsfw/pgif.js | 31 +++++++++++++++++++ commands/nsfw/pussy.js | 30 ++++++++++++++++++ commands/nsfw/realbooru.js | 27 +++++++++++++++++ commands/nsfw/rule34.js | 27 +++++++++++++++++ commands/nsfw/tentacle.js | 30 ++++++++++++++++++ commands/nsfw/thigh.js | 30 ++++++++++++++++++ commands/nsfw/xbooru.js | 27 +++++++++++++++++ commands/nsfw/yandere.js | 28 +++++++++++++++++ index.js | 3 +- package.json | 2 ++ utils/nsfwembed.js | 16 ++++++++++ 28 files changed, 787 insertions(+), 1 deletion(-) create mode 100644 commands/nsfw/4k.js create mode 100644 commands/nsfw/anal.js create mode 100644 commands/nsfw/ass.js create mode 100644 commands/nsfw/booru.js create mode 100644 commands/nsfw/danbooru.js create mode 100644 commands/nsfw/gelbooru.js create mode 100644 commands/nsfw/gonewild.js create mode 100644 commands/nsfw/hanal.js create mode 100644 commands/nsfw/hass.js create mode 100644 commands/nsfw/hentai.js create mode 100644 commands/nsfw/hkitsune.js create mode 100644 commands/nsfw/hthigh.js create mode 100644 commands/nsfw/hypnohub.js create mode 100644 commands/nsfw/konachan-lewd.js create mode 100644 commands/nsfw/konachan-safer.js create mode 100644 commands/nsfw/nekos-lewd.js create mode 100644 commands/nsfw/paizuri.js create mode 100644 commands/nsfw/pgif.js create mode 100644 commands/nsfw/pussy.js create mode 100644 commands/nsfw/realbooru.js create mode 100644 commands/nsfw/rule34.js create mode 100644 commands/nsfw/tentacle.js create mode 100644 commands/nsfw/thigh.js create mode 100644 commands/nsfw/xbooru.js create mode 100644 commands/nsfw/yandere.js create mode 100644 utils/nsfwembed.js diff --git a/commands/nsfw/4k.js b/commands/nsfw/4k.js new file mode 100644 index 0000000..1fb36c0 --- /dev/null +++ b/commands/nsfw/4k.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class FourK extends commando.Command { + constructor(client) { + super(client, { + name: "4k", + memberName: "4k", + group: "nsfw", + nsfw: true, + description: "KKKK", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "4k" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/anal.js b/commands/nsfw/anal.js new file mode 100644 index 0000000..48a5c7b --- /dev/null +++ b/commands/nsfw/anal.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +/*module.exports =*/ class Anal extends commando.Command { + constructor(client) { + super(client, { + name: "anal", + memberName: "anal", + group: "nsfw", + nsfw: true, + description: "Anal image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "anal" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/ass.js b/commands/nsfw/ass.js new file mode 100644 index 0000000..9c97049 --- /dev/null +++ b/commands/nsfw/ass.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class Ass extends commando.Command { + constructor(client) { + super(client, { + name: "ass", + memberName: "ass", + group: "nsfw", + nsfw: true, + description: "Ass image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "ass" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/booru.js b/commands/nsfw/booru.js new file mode 100644 index 0000000..c9e5fc1 --- /dev/null +++ b/commands/nsfw/booru.js @@ -0,0 +1,49 @@ +var cheerio = require("cheerio"); +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +module.exports = class Booru extends commando.Command { + constructor(client) { + super(client, { + name: "booru", + memberName: "booru", + group: "nsfw", + nsfw: true, + description: "Random image from booru site", + args: [ + { + type: "string", + key: "booru", + prompt: "Kterou booru stránku z booru.org použít?" + } + ] + }); + } + + async run(msg, { booru }) { + try { + var r = await fetch("http://" + booru + ".booru.org/"); + var max = 50; + + var s = cheerio.load(r.body); + max = parseInt(s("p:first-child").text().substr(8).replace(/,/g, "")); + + if(isNaN(max)) { + return msg.channel.send("Booru stránka nenalezena"); + } + + var url = "http://" + booru + ".booru.org/index.php?page=dapi&s=post&q=index&id=" + Math.floor(Math.random() * max); + var res = await fetch(url); + var $ = cheerio.load(await res.text(), { xmlMode: true }); + + var src = $("post").attr("file_url"); + var embed = await newEmbed(msg); + embed.setTitle(booru); + embed.setImage(src); + return msg.channel.send(embed); + } catch(e) { + return msg.channel.send("Booru stránka s tímto názvem nanelezena"); + } + } +}; diff --git a/commands/nsfw/danbooru.js b/commands/nsfw/danbooru.js new file mode 100644 index 0000000..e7f26e4 --- /dev/null +++ b/commands/nsfw/danbooru.js @@ -0,0 +1,26 @@ +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +module.exports = class Danbooru extends commando.Command { + constructor(client) { + super(client, { + name: "danbooru", + memberName: "danbooru", + group: "nsfw", + nsfw: true, + description: "Random image from danbooru" + }); + } + + async run(msg) { + var url = "https://danbooru.donmai.us/posts/" + Math.floor(Math.random() * 3830000) + ".json"; + const post = await fetch(url).then(r => r.json()); + + var embed = await newEmbed(msg); + embed.setTitle("Danbooru"); + embed.setDescription(post.tag_string_character); + embed.setImage(post.file_url); + return msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/gelbooru.js b/commands/nsfw/gelbooru.js new file mode 100644 index 0000000..61d5964 --- /dev/null +++ b/commands/nsfw/gelbooru.js @@ -0,0 +1,27 @@ +var cheerio = require("cheerio"); +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +module.exports = class Gelbooru extends commando.Command { + constructor(client) { + super(client, { + name: "gelbooru", + memberName: "gelbooru", + group: "nsfw", + nsfw: true, + description: "Random image from gelbooru" + }); + } + + async run(msg) { + const res = await fetch("https://gelbooru.com/index.php?page=dapi&s=post&q=index&id=" + Math.floor(Math.random() * 69317)); + var $ = cheerio.load(await res.text(), { xmlMode: true }); + + var src = $("post").attr("file_url"); + var embed = await newEmbed(msg); + embed.setTitle("Gelbooru"); + embed.setImage(src); + return msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/gonewild.js b/commands/nsfw/gonewild.js new file mode 100644 index 0000000..3fd7fd7 --- /dev/null +++ b/commands/nsfw/gonewild.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class Gonewild extends commando.Command { + constructor(client) { + super(client, { + name: "gonewild", + memberName: "gonewild", + group: "nsfw", + nsfw: true, + description: "Gonewild image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "gonewild" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/hanal.js b/commands/nsfw/hanal.js new file mode 100644 index 0000000..4674823 --- /dev/null +++ b/commands/nsfw/hanal.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +/*module.exports =*/ class Hanal extends commando.Command { + constructor(client) { + super(client, { + name: "hanal", + memberName: "hanal", + group: "nsfw", + nsfw: true, + description: "Hentai anal image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "hanal" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/hass.js b/commands/nsfw/hass.js new file mode 100644 index 0000000..c517ca2 --- /dev/null +++ b/commands/nsfw/hass.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class Hass extends commando.Command { + constructor(client) { + super(client, { + name: "hass", + memberName: "hass", + group: "nsfw", + nsfw: true, + description: "Ass image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "hass" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/hentai.js b/commands/nsfw/hentai.js new file mode 100644 index 0000000..1e358e1 --- /dev/null +++ b/commands/nsfw/hentai.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class Hentai extends commando.Command { + constructor(client) { + super(client, { + name: "hentai", + memberName: "hentai", + group: "nsfw", + nsfw: true, + description: "Hentai image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "hentai" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/hkitsune.js b/commands/nsfw/hkitsune.js new file mode 100644 index 0000000..31ffe33 --- /dev/null +++ b/commands/nsfw/hkitsune.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class Awooify extends commando.Command { + constructor(client) { + super(client, { + name: "hkitsune", + memberName: "hkitsune", + group: "nsfw", + nsfw: true, + description: "Hentai kitsune image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "hkitsune" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/hthigh.js b/commands/nsfw/hthigh.js new file mode 100644 index 0000000..09192ec --- /dev/null +++ b/commands/nsfw/hthigh.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class HThigh extends commando.Command { + constructor(client) { + super(client, { + name: "hthigh", + memberName: "hthigh", + group: "nsfw", + nsfw: true, + description: "Thigh image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "hthigh" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/hypnohub.js b/commands/nsfw/hypnohub.js new file mode 100644 index 0000000..252cd7c --- /dev/null +++ b/commands/nsfw/hypnohub.js @@ -0,0 +1,27 @@ +var cheerio = require("cheerio"); +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +/*module.exports =*/ class Hypnohub extends commando.Command { + constructor(client) { + super(client, { + name: "hypnohub", + memberName: "hypnohub", + group: "nsfw", + nsfw: true, + description: "HYPNO NSFW" + }); + } + + async run(msg) { + const res = await fetch("https://hypnohub.net/index.php?page=dapi&s=post&q=index&id=" + Math.floor(Math.random() * 69317)); + var $ = cheerio.load(await res.text(), { xmlMode: true }); + + var src = $("post").attr("file_url"); + var embed = await newEmbed(msg); + embed.setTitle("Hypnohub"); + embed.setImage(src); + return msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/konachan-lewd.js b/commands/nsfw/konachan-lewd.js new file mode 100644 index 0000000..6047542 --- /dev/null +++ b/commands/nsfw/konachan-lewd.js @@ -0,0 +1,28 @@ +var cheerio = require("cheerio"); +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +/* module.exports =*/ class KonachanLewd extends commando.Command { + constructor(client) { + super(client, { + name: "konachan-lewd", + memberName: "konachan-lewd", + alias: ["konachan"], + nsfw: true, + group: "nsfw", + description: "Random konachan image. NSFW." + }); + } + + async run(msg) { + const res = await fetch("https://konachan.com/index.php?page=dapi&s=post&q=index&id=" + Math.floor(Math.random() * 2412000)); + var $ = cheerio.load(await res.text(), { xmlMode: true }); + + var src = $("post").attr("file_url"); + var embed = await newEmbed(msg); + embed.setTitle("Konachan"); + embed.setImage(src); + return msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/konachan-safer.js b/commands/nsfw/konachan-safer.js new file mode 100644 index 0000000..757b4d3 --- /dev/null +++ b/commands/nsfw/konachan-safer.js @@ -0,0 +1,26 @@ +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +module.exports = class Konachan2 extends commando.Command { + constructor(client) { + super(client, { + name: "konachan-safer", + memberName: "konachan-safer", + aliases: ["konachan-safe", "konachan2"], + group: "nsfw", + nsfw: true, + description: "Random konachan image." + }); + } + + async run(msg) { + const res = await fetch("https://konachan.net/post.json?limit=1&page=" + Math.floor(Math.random() * 241260)); + var img = (await res.json())[0]; + var embed = await newEmbed(msg); + embed.setTitle("Konachan"); + embed.setDescription(`Od ${img.author}`); + embed.setImage(img.file_url); + return msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/nekos-lewd.js b/commands/nsfw/nekos-lewd.js new file mode 100644 index 0000000..a828bc7 --- /dev/null +++ b/commands/nsfw/nekos-lewd.js @@ -0,0 +1,54 @@ +const newEmbed = require("../../utils/nsfwembed"); +const Nekos = require("nekos.life"); +const neko = new Nekos().nsfw; +const commando = require("@iceprod/discord.js-commando"); + +module.exports = class NekosCommand extends commando.Command { + constructor(client) { + super(client, { + name: "nekos-lewd", + group: "nsfw", + nsfw: true, + memberName: "nekos", + description: "Uses the nekos.life API. NSFW only.", + examples: ["nekos-lewd help"], + args: [ + { + type: "string", + key: "command", + prompt: "Který příkaz chcete spustit?" + } + ] + }); + } + + async run(msg, cmd) { + var c = cmd.command; + + if(c === "help") return await this.help(); + + else { + if(typeof neko[c] === "function") { + return await this.nonText(c, msg); + } else { + return await msg.channel.send("Neexistující příkaz nebo SFW."); + } + } + } + + async nonText(cmd, msg) { + var json = await neko[cmd](); + return await this.send(json.url, msg); + } + + help() { + return this.msg.channel.send("Otevřete https://github.com/Nekos-life/nekos-dot-life pro dostupné příkazy. Použijte je jako `!nekos-lewd `. Pouze NSFW."); + } + + async send(src, msg) { + var embed = await newEmbed(msg); + embed.setTitle("Nekos!"); + embed.setImage(src); + return msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/paizuri.js b/commands/nsfw/paizuri.js new file mode 100644 index 0000000..e76e781 --- /dev/null +++ b/commands/nsfw/paizuri.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class Paizuri extends commando.Command { + constructor(client) { + super(client, { + name: "paizuri", + memberName: "paizuri", + group: "nsfw", + nsfw: true, + description: "Paizuri image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "paizuri" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/pgif.js b/commands/nsfw/pgif.js new file mode 100644 index 0000000..4d827a5 --- /dev/null +++ b/commands/nsfw/pgif.js @@ -0,0 +1,31 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +/*module.exports =*/ class PGif extends commando.Command { + constructor(client) { + super(client, { + name: "pgif", + memberName: "pgif", + aliases: ["porngif"], + nsfw: true, + group: "nsfw", + description: "Porn GIFs.", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "pgif" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/pussy.js b/commands/nsfw/pussy.js new file mode 100644 index 0000000..45ff3f4 --- /dev/null +++ b/commands/nsfw/pussy.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +/*module.exports =*/ class Pussy extends commando.Command { + constructor(client) { + super(client, { + name: "pussy", + memberName: "pussy", + group: "nsfw", + nsfw: true, + description: "Pussy image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "pussy" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/realbooru.js b/commands/nsfw/realbooru.js new file mode 100644 index 0000000..98b7430 --- /dev/null +++ b/commands/nsfw/realbooru.js @@ -0,0 +1,27 @@ +var cheerio = require("cheerio"); +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +/*module.exports =*/ class RealBooru extends commando.Command { + constructor(client) { + super(client, { + name: "realbooru", + memberName: "realbooru", + group: "nsfw", + nsfw: true, + description: "Real booru" + }); + } + + async run(msg) { + const res = await fetch("https://realbooru.com/index.php?page=dapi&s=post&q=index&id=" + Math.floor(Math.random() * 692475)); + var $ = cheerio.load(await res.text(), { xmlMode: true }); + + var src = $("post").attr("file_url"); + var embed = await newEmbed(msg); + embed.setTitle("Real booru"); + embed.setImage(src); + return msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/rule34.js b/commands/nsfw/rule34.js new file mode 100644 index 0000000..fa40c1a --- /dev/null +++ b/commands/nsfw/rule34.js @@ -0,0 +1,27 @@ +var cheerio = require("cheerio"); +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +module.exports = class R34 extends commando.Command { + constructor(client) { + super(client, { + name: "rule34", + memberName: "rule34", + group: "nsfw", + nsfw: true, + description: "Random safebooru image." + }); + } + + async run(msg) { + const res = await fetch("https://rule34.xxx/index.php?page=dapi&s=post&q=index&id=" + Math.floor(Math.random() * 3297000)); + var $ = cheerio.load(await res.text(), { xmlMode: true }); + + var src = $("post").attr("file_url"); + var embed = await newEmbed(msg); + embed.setTitle("Rule34"); + embed.setImage(src); + return await msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/tentacle.js b/commands/nsfw/tentacle.js new file mode 100644 index 0000000..202a6fa --- /dev/null +++ b/commands/nsfw/tentacle.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class Awooify extends commando.Command { + constructor(client) { + super(client, { + name: "tentacle", + memberName: "tentacle", + group: "nsfw", + nsfw: true, + description: "Tentacle image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "tentacle" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/thigh.js b/commands/nsfw/thigh.js new file mode 100644 index 0000000..8e5c11a --- /dev/null +++ b/commands/nsfw/thigh.js @@ -0,0 +1,30 @@ +const commando = require("@iceprod/discord.js-commando"); +const fetch = require("node-fetch"); + +module.exports = class Awooify extends commando.Command { + constructor(client) { + super(client, { + name: "thigh", + memberName: "thigh", + group: "nsfw", + nsfw: true, + description: "Thigh image", + args: [] + }); + } + + async run(msg) { + var params = new URLSearchParams({ + type: "thigh" + }); + var data = await fetch("https://nekobot.xyz/api/image?" + params.toString()).then(r => r.json()); + if(!data.success) { + return msg.channel.send("Selhalo načítání obrázku"); + } + return msg.channel.send({ + files: [ + data.message + ] + }); + } +}; diff --git a/commands/nsfw/xbooru.js b/commands/nsfw/xbooru.js new file mode 100644 index 0000000..4691087 --- /dev/null +++ b/commands/nsfw/xbooru.js @@ -0,0 +1,27 @@ +var cheerio = require("cheerio"); +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +/*module.exports =*/ class XBooru extends commando.Command { + constructor(client) { + super(client, { + name: "xbooru", + memberName: "xbooru", + group: "nsfw", + nsfw: true, + description: "Dirty sister of rule34" + }); + } + + async run(msg) { + var res = await fetch("https://xbooru.com/index.php?page=dapi&s=post&q=index&id=" + Math.floor(Math.random() * 709426)); + var $ = cheerio.load(await res.text(), { xmlMode: true }); + + var src = $("post").attr("file_url"); + var embed = await newEmbed(msg); + embed.setTitle("Xbooru"); + embed.setImage(src); + return await msg.channel.send(embed); + } +}; diff --git a/commands/nsfw/yandere.js b/commands/nsfw/yandere.js new file mode 100644 index 0000000..32818b2 --- /dev/null +++ b/commands/nsfw/yandere.js @@ -0,0 +1,28 @@ +const commando = require("@iceprod/discord.js-commando"); +const newEmbed = require("../../utils/nsfwembed"); +const fetch = require("node-fetch"); + +module.exports = class Xkcd extends commando.Command { + constructor(client) { + super(client, { + name: "yandere", + memberName: "yandere", + group: "nsfw", + nsfw: true, + description: "Random image of yandere" + }); + } + + async run(msg) { + var url = "https://yande.re/post.json?limit=1&page=" + Math.floor(Math.random() * 621767); + var res = await fetch(url); + var post = (await res.json())[0]; + + var embed = await newEmbed(msg); + embed.setTitle("Yandere"); + embed.setDescription("Od " + post.author + "\nObrázky se mohou načítat nějakou dobu."); + embed.setImage(post.file_url); + embed.setThumbnail(post.sample_url); + return msg.channel.send(embed); + } +}; diff --git a/index.js b/index.js index d6c6e1e..5a5df6b 100644 --- a/index.js +++ b/index.js @@ -48,7 +48,8 @@ client.on("commandRun", (c, p, msg, args) => { client.registry .registerGroups([ ["ssps", "Příkazy pro SSPŠ"], - ["nastaveni", "Nastavení bota"] + ["nastaveni", "Nastavení bota"], + ["nsfw", "Horny bonk"] ]) .registerDefaultTypes() .registerCommandsIn(path.join(__dirname, 'commands')); diff --git a/package.json b/package.json index 82b6755..a293bef 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,14 @@ { "dependencies": { "@iceprod/discord.js-commando": "^0.14.4", + "cheerio": "^1.0.0-rc.10", "discord.js": "12", "fs-extra": "^10.0.0", "js-yaml": "^4.1.0", "luxon": "^2.0.2", "mariadb": "^2.5.5", "minimist": "^1.2.5", + "nekos.life": "^2.0.7", "node-fetch": "2", "sequelize": "^6.7.0", "sqlite": "^4.0.23", diff --git a/utils/nsfwembed.js b/utils/nsfwembed.js new file mode 100644 index 0000000..c06b319 --- /dev/null +++ b/utils/nsfwembed.js @@ -0,0 +1,16 @@ +const { MessageEmbed } = require("discord.js"); + +module.exports = async function newEmbed(msg) { + const guild = msg.client.guilds.resolve("854063584007028737"); + if(guild) { + const channel = guild.channels.resolve("906254606659629126"); + if(channel) { + channel.send(`<@${msg.author.id}> got horny, used ${msg.command?.name}`); + } + } + return new MessageEmbed({ + author: { + name: `${msg.member ? msg.member.displayName : msg.author.nickname} got horny` + } + }); +} \ No newline at end of file