mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 22:53:06 -04:00
a bunch of things also deepai
This commit is contained in:
parent
aec828beb5
commit
0c4e48bd39
9 changed files with 219 additions and 6 deletions
39
commands/message/image/deepai/deepdream.js
Normal file
39
commands/message/image/deepai/deepdream.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
const { getRecentImage } = require("../../../../labscore/utils/attachment");
|
||||
const { createEmbed } = require("../../../../labscore/utils/embed");
|
||||
const { editOrReply } = require("../../../../labscore/utils/message");
|
||||
|
||||
const { deepdream } = require('../../../../labscore/api')
|
||||
|
||||
module.exports = {
|
||||
name: 'deepdream',
|
||||
aliases: ['dd'],
|
||||
metadata: {
|
||||
description: 'deepdream',
|
||||
examples: ['deepdream'],
|
||||
category: 'image',
|
||||
usage: 'deepdream <image>'
|
||||
},
|
||||
run: async (context, args) => {
|
||||
context.triggerTyping();
|
||||
try{
|
||||
let image = await getRecentImage(context, 50)
|
||||
if(!image) return editOrReply(context, { embeds: [createEmbed("warning", context, "No images found.")] })
|
||||
|
||||
let res = await deepdream(context, image)
|
||||
|
||||
if(res.response.body.status == 1) return editOrReply(context, {embeds:[createEmbed("warning", context, res.response.body.errors[0])]})
|
||||
return editOrReply(context, {embeds:[createEmbed("default", context, {
|
||||
image: {
|
||||
url: res.response.body.image
|
||||
},
|
||||
footer: {
|
||||
iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`,
|
||||
text: `${context.application.name} • Took ${res.timings}s`
|
||||
}
|
||||
})]})
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
return editOrReply(context, {embeds:[createEmbed("error", context, `Unable to modify image.`)]})
|
||||
}
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue