mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 22:23:03 -04:00
wip
This commit is contained in:
parent
7195d43c74
commit
6173b085a3
26 changed files with 1112 additions and 91 deletions
38
commands/message/image/photofunia/yacht.js
Normal file
38
commands/message/image/photofunia/yacht.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
const { createEmbed } = require('../../../../labscore/utils/embed')
|
||||
const { editOrReply } = require('../../../../labscore/utils/message')
|
||||
const { STATICS } = require('../../../../labscore/utils/statics')
|
||||
|
||||
const { yacht } = require('../../../../labscore/api')
|
||||
|
||||
module.exports = {
|
||||
name: 'yacht',
|
||||
label: 'text',
|
||||
metadata: {
|
||||
description: 'crazy yacht',
|
||||
examples: ['yacht Im on a boat.'],
|
||||
category: 'image',
|
||||
usage: 'yacht <text>'
|
||||
},
|
||||
run: async (context, args) => {
|
||||
context.triggerTyping();
|
||||
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
|
||||
if(args.text.length >= 26) return editOrReply(context, {embeds:[createEmbed("warning", context, `Parameter text too long (>25).`)]})
|
||||
try{
|
||||
let res = await yacht(context, args.text)
|
||||
image = res.response.body.data.images[res.response.body.data.best_quality]
|
||||
return editOrReply(context, {embeds:[createEmbed("default", context, {
|
||||
description: `⛵`,
|
||||
image: {
|
||||
url: image
|
||||
},
|
||||
footer: {
|
||||
iconUrl: STATICS.photofunia,
|
||||
text: `PhotoFunia • ${context.application.name} • Took ${res.timings}s`
|
||||
}
|
||||
})]})
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
return editOrReply(context, {embeds:[createEmbed("error", context, `Unable to generate image.`)]})
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue