From b625ee982e3f102fa9a22467fb6633fbf6b0a27a Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 21 Mar 2024 20:36:23 -0400 Subject: [PATCH] Remove non-working commands --- commands/random-seed/adorable.js | 45 -------------------- commands/random-seed/dicebear.js | 70 -------------------------------- commands/random-seed/robohash.js | 38 ----------------- 3 files changed, 153 deletions(-) delete mode 100644 commands/random-seed/adorable.js delete mode 100644 commands/random-seed/dicebear.js delete mode 100644 commands/random-seed/robohash.js diff --git a/commands/random-seed/adorable.js b/commands/random-seed/adorable.js deleted file mode 100644 index 4b7db5f4..00000000 --- a/commands/random-seed/adorable.js +++ /dev/null @@ -1,45 +0,0 @@ -const Command = require('../../framework/Command'); -const request = require('node-superfetch'); - -module.exports = class AdorableCommand extends Command { - constructor(client) { - super(client, { - name: 'adorable', - aliases: ['adorable-avatar'], - group: 'random-seed', - memberName: 'adorable', - description: 'Creates an adorable avatar based on the text you provide.', - clientPermissions: ['ATTACH_FILES'], - credit: [ - { - name: 'Adorable Avatars', - url: 'http://avatars.adorable.io/', - reason: 'Original API' - }, - { - name: 'gfauchart', - url: 'https://github.com/gfauchart', - reason: 'API', - reasonURL: 'https://github.com/adorableio/avatars-api-middleware/issues/108' - } - ], - args: [ - { - key: 'text', - prompt: 'What text should be used for generation?', - type: 'string', - parse: text => encodeURIComponent(text) - } - ] - }); - } - - async run(msg, { text }) { - try { - const { body } = await request.get(`https://api.hello-avatar.com/adorables/285/${text}.png`); - return msg.say({ files: [{ attachment: body, name: 'adorable.png' }] }); - } catch (err) { - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/commands/random-seed/dicebear.js b/commands/random-seed/dicebear.js deleted file mode 100644 index 198aa414..00000000 --- a/commands/random-seed/dicebear.js +++ /dev/null @@ -1,70 +0,0 @@ -const Command = require('../../framework/Command'); -const request = require('node-superfetch'); -const { createCanvas, loadImage } = require('canvas'); -const { list } = require('../../util/Util'); -const emotions = ['happy', 'sad', 'surprised']; - -module.exports = class DicebearCommand extends Command { - constructor(client) { - super(client, { - name: 'dicebear', - aliases: ['dicebear-avatar'], - group: 'random-seed', - memberName: 'dicebear', - description: 'Creates a DiceBear avatar based on the text you provide.', - clientPermissions: ['ATTACH_FILES'], - throttling: { - usages: 2, - duration: 10 - }, - credit: [ - { - name: 'DiceBear Avatars', - url: 'https://avatars.dicebear.com/', - reason: 'API' - } - ], - args: [ - { - key: 'gender', - prompt: 'What gender do you want to use? Either male or female.', - type: 'string', - oneOf: ['male', 'female'], - parse: gender => gender.toLowerCase() - }, - { - key: 'emotion', - prompt: `What emotion should the avatar display? Either ${list(emotions, 'or')}.`, - type: 'string', - oneOf: emotions, - parse: emotion => emotion.toLowerCase() - }, - { - key: 'text', - prompt: 'What text should be used for generation?', - type: 'string', - parse: text => encodeURIComponent(text) - } - ] - }); - } - - async run(msg, { gender, emotion, text }) { - try { - const { body } = await request - .get(`https://avatars.dicebear.com/api/${gender}/${text}.svg`) - .query({ - width: 285, - height: 285, - 'mood[]': emotion - }); - const canvas = createCanvas(285, 285); - const ctx = canvas.getContext('2d'); - const img = await loadImage(body); - ctx.drawImage(img, 0, 0, 285, 285); - return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'dicebear.png' }] }); - } catch (err) { - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/commands/random-seed/robohash.js b/commands/random-seed/robohash.js deleted file mode 100644 index 17e0a041..00000000 --- a/commands/random-seed/robohash.js +++ /dev/null @@ -1,38 +0,0 @@ -const Command = require('../../framework/Command'); -const request = require('node-superfetch'); - -module.exports = class RobohashCommand extends Command { - constructor(client) { - super(client, { - name: 'robohash', - group: 'random-seed', - memberName: 'robohash', - description: 'Creates a robot based on the text you provide.', - clientPermissions: ['ATTACH_FILES'], - credit: [ - { - name: 'RoboHash', - url: 'https://robohash.org/', - reason: 'API' - } - ], - args: [ - { - key: 'text', - prompt: 'What text should be used for generation?', - type: 'string', - parse: text => encodeURIComponent(text) - } - ] - }); - } - - async run(msg, { text }) { - try { - const { body } = await request.get(`https://robohash.org/${text}`); - return msg.say({ files: [{ attachment: body, name: 'robohash.png' }] }); - } catch (err) { - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -};