mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-18 10:57:05 -04:00
make all image responses use the same embed type
This commit is contained in:
parent
951cb87a82
commit
43d8801821
14 changed files with 138 additions and 152 deletions
|
@ -22,15 +22,11 @@ module.exports = {
|
|||
let res = await text2image(context, args.text)
|
||||
|
||||
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`
|
||||
}
|
||||
})]})
|
||||
|
||||
return editOrReply(context, createEmbed("image", context, {
|
||||
url: res.response.body.image,
|
||||
time: res.timings
|
||||
}))
|
||||
}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