make all image responses use the same embed type

This commit is contained in:
derpystuff 2022-06-28 18:58:04 +02:00
parent 951cb87a82
commit 43d8801821
14 changed files with 138 additions and 152 deletions

View file

@ -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.`)]})