mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 22:53:06 -04:00
clean up
This commit is contained in:
parent
c25e876962
commit
128369350f
24 changed files with 17 additions and 45 deletions
|
@ -22,19 +22,20 @@ async function fetchImage(url) {
|
|||
}
|
||||
|
||||
async function processMakesweet(effect, args, image) {
|
||||
if(!effects[effect.toLowerCase()]) throw "Invalid Effect"
|
||||
try{
|
||||
if(image){
|
||||
image = await fetchImage(image)
|
||||
if(!image) throw "Unable to fetch image"
|
||||
|
||||
let res = await superagent.post(`http://api.makesweet.com/make/${effect}`)
|
||||
let res = await superagent.post(`http://api.makesweet.com/make/${effect.toLowerCase()}`)
|
||||
.set("Authorization", process.env.makesweet)
|
||||
.buffer(true)
|
||||
.query(args)
|
||||
.attach('image', image, 'image.png')
|
||||
return res;
|
||||
}
|
||||
let res = await superagent.post(`http://api.makesweet.com/make/${effect}`)
|
||||
let res = await superagent.post(`http://api.makesweet.com/make/${effect.toLowerCase()}`)
|
||||
.set("Authorization", process.env.makesweet)
|
||||
.buffer(true)
|
||||
.query(args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue