From 41317a0e87df05888408c2ceff6401f8970cc723 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Mon, 20 Jun 2022 21:45:27 +0200 Subject: [PATCH] otter command!! --- commands/message/fun/art.js | 1 - commands/message/fun/otter.js | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 commands/message/fun/otter.js diff --git a/commands/message/fun/art.js b/commands/message/fun/art.js index 246d299..7151438 100644 --- a/commands/message/fun/art.js +++ b/commands/message/fun/art.js @@ -19,7 +19,6 @@ function validateNumber(input, low, high){ module.exports = { name: 'art', aliases: ['wallpaper'], - label: 'text', metadata: { description: 'crazy ai art', examples: ['art -type wallpaper -seed 839648 -variance 8866 -rotate 1'], diff --git a/commands/message/fun/otter.js b/commands/message/fun/otter.js new file mode 100644 index 0000000..ecc5131 --- /dev/null +++ b/commands/message/fun/otter.js @@ -0,0 +1,40 @@ +const { createEmbed } = require('../../../labscore/utils/embed') +const { editOrReply } = require('../../../labscore/utils/message') + +const superagent = require('superagent'); + +module.exports = { + name: 'otter', + metadata: { + description: 'random otter!!', + examples: ['otter'], + category: 'fun', + usage: `otter` + }, + run: async (context, args) => { + await context.triggerTyping(); + try{ + let res = await superagent.get(`https://otter.bruhmomentlol.repl.co/random`) + .set("User-Agent","labscore/2.0") + + await editOrReply(context, { + embeds: [ + createEmbed("default", context, { + image: { + url: `attachment://otter.${res.headers["x-file-ext"]}` + } + }) + ], + files: [ + { + filename: `otter.${res.headers["x-file-ext"]}`, + value: res.body + } + ] + }) + }catch(e){ + console.log(e) + return editOrReply(context, {embeds:[createEmbed("error", context, `Unable to fetch otter.`)]}) + } + } +}; \ No newline at end of file