diff --git a/README.md b/README.md index 3603fa37..1ad8785e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can join the home server with [this link](https://discord.gg/fqQF8mc). [discord.js](https://discord.js.org), [commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://visionmedia.github.io/superagent), [mathjs](http://mathjs.org), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org), [sequelize](http://docs.sequelizejs.com), [pg](https://github.com/brianc/node-postgres) ## APIs -[Wattpad](https://developer.wattpad.com), [Wordnik](http://developer.wordnik.com), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link), [YuGiOh](http://docs.yugiohprices.apiary.io), [YouTube](https://developers.google.com/youtube), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com), [Yahoo Weather](https://developer.yahoo.com/weather), [Google Maps](https://developers.google.com/maps), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [rrrather](http://www.rrrather.com/botapi), [SoundCloud](https://developers.soundcloud.com), [random.cat](http://random.cat), [random.dog](https://random.dog), [fixer.io](http://fixer.io), [konachan](https://konachan.net) +[Wattpad](https://developer.wattpad.com), [Wordnik](http://developer.wordnik.com), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link), [YuGiOh](http://docs.yugiohprices.apiary.io), [YouTube](https://developers.google.com/youtube), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com), [Yahoo Weather](https://developer.yahoo.com/weather), [Google Maps](https://developers.google.com/maps), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [rrrather](http://www.rrrather.com/botapi), [SoundCloud](https://developers.soundcloud.com), [random.cat](http://random.cat), [random.dog](https://random.dog), [fixer.io](http://fixer.io), [konachan](https://konachan.net), [lolibooru](https://lolibooru.moe) ## Licensing The bot is licensed under an [ISC License](https://opensource.org/licenses/ISC). See the file `LICENSE.md` for more information. diff --git a/commands/randomimg/nsfwanime.js b/commands/randomimg/konachan.js similarity index 80% rename from commands/randomimg/nsfwanime.js rename to commands/randomimg/konachan.js index 4ea9108b..a072d1f6 100644 --- a/commands/randomimg/nsfwanime.js +++ b/commands/randomimg/konachan.js @@ -1,13 +1,13 @@ const { Command } = require('discord.js-commando'); const request = require('superagent'); -module.exports = class NSFWAnimeCommand extends Command { +module.exports = class KonachanCommand extends Command { constructor(client) { super(client, { - name: 'nsfw-anime', + name: 'konachan', group: 'randomimg', - memberName: 'nsfw-anime', - description: 'Sends a random (NSFW!) anime image.', + memberName: 'konachan', + description: 'Sends a random (Possibly NSFW!) anime image from Konachan.', guildOnly: true }); } diff --git a/commands/randomimg/lolibooru.js b/commands/randomimg/lolibooru.js new file mode 100644 index 00000000..813647d4 --- /dev/null +++ b/commands/randomimg/lolibooru.js @@ -0,0 +1,28 @@ +const { Command } = require('discord.js-commando'); +const request = require('superagent'); + +module.exports = class LolibooruCommand extends Command { + constructor(client) { + super(client, { + name: 'lolibooru', + group: 'randomimg', + memberName: 'lolibooru', + description: 'Sends a random (Possibly NSFW!) anime image from Lolibooru.', + guildOnly: true + }); + } + + async run(msg) { + if (!msg.channel.nsfw) return msg.say('This Command can only be used in NSFW Channels.'); + if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) + return msg.say('This Command requires the `Attach Files` Permission.'); + try { + const { body } = await request + .get('https://lolibooru.moe/post/index.json?tags=order:random&limit=1'); + return msg.channel.send({ files: [`https:${body[0].file_url}`] }) + .catch(err => msg.say(err)); + } catch (err) { + return msg.say(err); + } + } +}; diff --git a/commands/util/info.js b/commands/util/info.js index 81c7253f..b03859e0 100644 --- a/commands/util/info.js +++ b/commands/util/info.js @@ -83,7 +83,8 @@ module.exports = class InfoCommand extends Command { [random.cat](http://random.cat), [random.dog](https://random.dog), [fixer.io](http://fixer.io), - [konachan](https://konachan.net) + [konachan](https://konachan.net), + [lolibooru](https://lolibooru.moe) ` ); return msg.embed(embed); diff --git a/html/carbondesc.html b/html/carbondesc.html index fd47da66..0d805e94 100644 --- a/html/carbondesc.html +++ b/html/carbondesc.html @@ -53,6 +53,7 @@