The bot can now actually interact with the API, fixed issues relating to leaving voice channels

This commit is contained in:
TheEssem 2020-09-01 21:52:12 -05:00
parent fdc08575f3
commit a6137436d2
4 changed files with 37 additions and 20 deletions

View file

@ -9,12 +9,12 @@ const storage = multer.diskStorage({
cb(null, "/tmp/");
},
filename: function(req, file, cb) {
cb(null, Date.now() + path.extname(file.originalname)); //Appending extension
cb(null, Date.now() + path.extname(file.originalname));
}
});
const upload = multer({ storage: storage });
const app = express();
const port = 3000;
const port = process.env.API_PORT || 3000;
const formats = ["image/jpeg", "image/png", "image/webp", "image/gif"];
@ -39,8 +39,8 @@ app.post("/:method", upload.single("image"), async (req, res, next) => {
}
try {
const data = await magick(object);
res.contentType(type).send(data);
const data = await magick(object, true);
res.send(data);
} catch (e) {
next(e);
}