mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-10 23:23:08 -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
|
@ -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.`)]})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue