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

@ -17,23 +17,13 @@ module.exports = {
let res = await superagent.get(`https://otter.bruhmomentlol.repl.co/random`)
.set("User-Agent","labscore/2.0")
await editOrReply(context, {
embeds: [
createEmbed("default", context, {
image: {
url: `attachment://otter.${res.headers["x-file-ext"]}`
}
})
],
files: [
{
filename: `otter.${res.headers["x-file-ext"]}`,
value: res.body
}
]
return await editOrReply(context, {
embeds: [ createEmbed("image", context, {
url: `otter.${res.headers["x-file-ext"]}`
})],
files: [{ filename: `otter.${res.headers["x-file-ext"]}`, value: res.body }]
})
}catch(e){
console.log(e)
return editOrReply(context, {embeds:[createEmbed("error", context, `Unable to fetch otter.`)]})
}
}