Attempt to move image processing to an eris-fleet service

This commit is contained in:
Essem 2021-07-05 19:20:21 -05:00
parent 736207075b
commit 97050f0cf1
No known key found for this signature in database
GPG key ID: 2502A99EDC3F6FB9
8 changed files with 302 additions and 306 deletions

View file

@ -1,5 +1,4 @@
const Command = require("./command.js");
const magick = require("../utils/image.js");
const imageDetect = require("../utils/imagedetect.js");
const collections = require("../utils/collections.js");
const { emotes } = require("../messages.json");
@ -99,12 +98,12 @@ class ImageCommand extends Command {
}
try {
const { buffer, type } = await magick.run(magickParams).catch(e => {
const { buffer, type } = await this.ipc.command("image", { type: "run", obj: magickParams }, true).catch(e => {
throw e;
});
if (type === "nogif" && this.constructor.requiresGIF) return "That isn't a GIF!";
return {
file: buffer,
file: Buffer.from(buffer.data),
name: `${this.constructor.command}.${type}`
};
} catch (e) {