From 8ae3b9956f0eda92556aad2835f4deb7821f7da9 Mon Sep 17 00:00:00 2001 From: Expand-sys Date: Tue, 28 Feb 2023 16:17:51 +1100 Subject: [PATCH] butts --- commands/slashcommands/utility/deepdream.js | 52 +++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 commands/slashcommands/utility/deepdream.js diff --git a/commands/slashcommands/utility/deepdream.js b/commands/slashcommands/utility/deepdream.js new file mode 100644 index 0000000..e07b506 --- /dev/null +++ b/commands/slashcommands/utility/deepdream.js @@ -0,0 +1,52 @@ +const deepai = require('deepai') +deepai.setApiKey(process.env.DEEPAI_API) +const https = require("https") +const http = require("http") +const fs = require("fs") +const { CommandInteraction, ApplicationCommandType, ApplicationCommandOptionType, EmbedBuilder } = require ('discord.js'); +const { sendResponse, sendReply } = require ('../../../utils/utils'); +const { Embed } = require ("@discordjs/builders"); + + +module.exports = { + name: `deepdream`, + description: `deep dream an image`, + cooldown: 5, + type: ApplicationCommandType.ChatInput, + options: [ + { + name: `image`, + description: `your image to be edited by image generator`, + type: ApplicationCommandOptionType.Attachment, + required: true, + } + ], + /** + * @param {CommandInteraction} interaction + */ + async execute(interaction) { + let image_url = null + let imageurl = interaction.options.getAttachment("image").url + interaction.deferReply() + + var resp = await deepai.callStandardApi("deep-dream", { + image: `${imageurl}`, + }) + + + let embed = await new Embed({ + "type": "rich", + "title": ``, + "description": "", + "color": 0xa70909, + "image": { + "url": `${resp.output_url}`, + "height": 0, + "width": 0 + }, + + }) + await interaction.editReply({embeds: [embed]}) + + } +} \ No newline at end of file