From 2cfafb83f8c52354d543c60453d431e4629c6ac5 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Wed, 20 Mar 2024 19:05:07 -0400 Subject: [PATCH] kill a few random image commands --- .env.example | 1 + commands/random-img/food.js | 34 ------------------------- commands/random-img/hentai.js | 40 ------------------------------ commands/random-img/kemonomimi.js | 32 ------------------------ commands/random-img/porn.js | 41 ------------------------------- commands/random-img/red-panda.js | 32 ------------------------ 6 files changed, 1 insertion(+), 179 deletions(-) delete mode 100644 commands/random-img/food.js delete mode 100644 commands/random-img/hentai.js delete mode 100644 commands/random-img/kemonomimi.js delete mode 100644 commands/random-img/porn.js delete mode 100644 commands/random-img/red-panda.js diff --git a/.env.example b/.env.example index 4709f6d4..bb65d976 100644 --- a/.env.example +++ b/.env.example @@ -83,4 +83,5 @@ XIAO_GITHUB_REPO_NAME= XIAO_GITHUB_REPO_USERNAME= # Imgur album IDs +POTATO_ALBUM_ID= XIAO_ALBUM_ID= diff --git a/commands/random-img/food.js b/commands/random-img/food.js deleted file mode 100644 index c56d19bb..00000000 --- a/commands/random-img/food.js +++ /dev/null @@ -1,34 +0,0 @@ -const Command = require('../../framework/Command'); -const request = require('node-superfetch'); -const cheerio = require('cheerio'); - -module.exports = class FoodCommand extends Command { - constructor(client) { - super(client, { - name: 'food', - aliases: ['this-food-does-not-exist', 'this-snack-does-not-exist', 'ai-snack', 'ai-food', 'snack'], - group: 'random-img', - memberName: 'food', - description: 'Responds with a randomly generated food.', - credit: [ - { - name: 'This Snack Does Not Exist', - url: 'https://thissnackdoesnotexist.com/', - reason: 'API' - } - ] - }); - } - - async run(msg) { - try { - const { text } = await request.get('https://thissnackdoesnotexist.com/'); - const $ = cheerio.load(text); - const img = $('div[class="Absolute-Center"]').first().attr('style').match(/background-image:url\((.+)\);/i); - const name = $('h1[class="snack-description"]').first().text(); - return msg.say(name, img ? { files: [{ attachment: img[1], name: 'ai-food.jpg' }] } : {}); - } catch (err) { - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/commands/random-img/hentai.js b/commands/random-img/hentai.js deleted file mode 100644 index 8c6add9f..00000000 --- a/commands/random-img/hentai.js +++ /dev/null @@ -1,40 +0,0 @@ -const SubredditCommand = require('../../structures/commands/Subreddit'); -const { list } = require('../../util/Util'); -const subreddits = require('../../assets/json/hentai'); - -module.exports = class HentaiCommand extends SubredditCommand { - constructor(client) { - super(client, { - name: 'hentai', - group: 'random-img', - memberName: 'hentai', - description: 'Responds with a random hentai image.', - details: `**Subreddits:** ${subreddits.join(', ')}`, - clientPermissions: ['EMBED_LINKS'], - nsfw: true, - postType: 'image', - getIcon: true, - credit: [ - { - name: '0vertime-dev', - url: 'https://github.com/0vertime-dev', - reason: 'Original Subreddit List' - } - ], - args: [ - { - key: 'subreddit', - prompt: `What subreddit do you want to get hentai from? Either ${list(subreddits, 'or')}.`, - type: 'string', - oneOf: subreddits, - default: () => subreddits[Math.floor(Math.random() * subreddits.length)], - parse: subreddit => subreddit.toLowerCase() - } - ] - }); - } - - generateText(post, subreddit, icon) { - return this.makeEmbed(post, subreddit, icon); - } -}; diff --git a/commands/random-img/kemonomimi.js b/commands/random-img/kemonomimi.js deleted file mode 100644 index 2d9fd546..00000000 --- a/commands/random-img/kemonomimi.js +++ /dev/null @@ -1,32 +0,0 @@ -const Command = require('../../framework/Command'); -const request = require('node-superfetch'); - -module.exports = class KemonomimiCommand extends Command { - constructor(client) { - super(client, { - name: 'kemonomimi', - aliases: ['cat-girl', 'nekomusume', '猫娘', '獣耳'], - group: 'random-img', - memberName: 'kemonomimi', - description: 'Responds with a random kemonomimi image.', - clientPermissions: ['ATTACH_FILES'], - credit: [ - { - name: 'noticeme.moe', - url: 'https://noticeme.moe/', - reason: 'API', - reasonURL: 'https://noticeme.moe/kemonomimi.php' - } - ] - }); - } - - async run(msg) { - try { - const { body } = await request.get('https://noticeme.moe/kemonomimi.php'); - return msg.say({ files: [body] }); - } catch (err) { - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/commands/random-img/porn.js b/commands/random-img/porn.js deleted file mode 100644 index 7fcd0149..00000000 --- a/commands/random-img/porn.js +++ /dev/null @@ -1,41 +0,0 @@ -const SubredditCommand = require('../../structures/commands/Subreddit'); -const { list } = require('../../util/Util'); -const subreddits = require('../../assets/json/porn'); - -module.exports = class PornCommand extends SubredditCommand { - constructor(client) { - super(client, { - name: 'porn', - aliases: ['pornography', 'porno'], - group: 'random-img', - memberName: 'porn', - description: 'Responds with a random porn image.', - details: `**Subreddits:** ${subreddits.join(', ')}`, - clientPermissions: ['EMBED_LINKS'], - nsfw: true, - postType: 'image', - getIcon: true, - credit: [ - { - name: '0vertime-dev', - url: 'https://github.com/0vertime-dev', - reason: 'Original Subreddit List' - } - ], - args: [ - { - key: 'subreddit', - prompt: `What subreddit do you want to get porn from? Either ${list(subreddits, 'or')}.`, - type: 'string', - oneOf: subreddits, - default: () => subreddits[Math.floor(Math.random() * subreddits.length)], - parse: subreddit => subreddit.toLowerCase() - } - ] - }); - } - - generateText(post, subreddit, icon) { - return this.makeEmbed(post, subreddit, icon); - } -}; diff --git a/commands/random-img/red-panda.js b/commands/random-img/red-panda.js deleted file mode 100644 index 3faf4059..00000000 --- a/commands/random-img/red-panda.js +++ /dev/null @@ -1,32 +0,0 @@ -const Command = require('../../framework/Command'); -const request = require('node-superfetch'); - -module.exports = class RedPandaCommand extends Command { - constructor(client) { - super(client, { - name: 'red-panda', - aliases: ['r-panda'], - group: 'random-img', - memberName: 'red-panda', - description: 'Responds with a random red panda image.', - clientPermissions: ['ATTACH_FILES'], - credit: [ - { - name: 'redpanda.pics', - url: 'https://redpanda.pics/', - reason: 'API', - reasonURL: 'https://github.com/NexInfinite/redpandapics' - } - ] - }); - } - - async run(msg) { - try { - const { body } = await request.get('https://redpanda.pics/random'); - return msg.say({ files: [body.url] }); - } catch (err) { - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -};