From 7f21d5d529b4fc32cd6c6d7a9a8308b4365d91aa Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 17 May 2017 21:29:04 +0000 Subject: [PATCH] Remove lolibooru --- commands/nsfw/lolibooru.js | 42 -------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 commands/nsfw/lolibooru.js diff --git a/commands/nsfw/lolibooru.js b/commands/nsfw/lolibooru.js deleted file mode 100644 index ea85a736..00000000 --- a/commands/nsfw/lolibooru.js +++ /dev/null @@ -1,42 +0,0 @@ -const { Command } = require('discord.js-commando'); -const snekfetch = require('snekfetch'); - -module.exports = class LolibooruCommand extends Command { - constructor(client) { - super(client, { - name: 'lolibooru', - group: 'nsfw', - memberName: 'lolibooru', - description: 'Sends an image from Lolibooru, with optional query.', - guildOnly: true, - args: [ - { - key: 'query', - prompt: 'What would you like to search for?', - type: 'string', - default: '' - } - ] - }); - } - - async run(msg, args) { - 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.'); - const { query } = args; - try { - const { body } = await snekfetch - .get('https://lolibooru.moe/post/index.json') - .query({ - tags: `${query ? `${query} ` : ''}order:random`, - limit: 1 - }); - if (!body.length) throw new Error('No Results.'); - return msg.say(query ? `Result for ${query}:` : 'Random Image:', { files: [body[0].file_url] }) - .catch(err => msg.say(`${err.name}: ${err.message}`)); - } catch (err) { - return msg.say(`${err.name}: ${err.message}`); - } - } -};