Replace deprecated image service functions
This commit is contained in:
parent
6475c91fbc
commit
25e2ac088f
4 changed files with 6 additions and 8 deletions
|
@ -100,16 +100,14 @@ class ImageCommand extends Command {
|
|||
}
|
||||
|
||||
try {
|
||||
const { buffer, type } = await this.ipc.command("image", { type: "run", obj: magickParams }, true).catch(e => {
|
||||
throw e;
|
||||
});
|
||||
const { buffer, type } = await this.ipc.serviceCommand("image", { type: "run", obj: magickParams }, true, 9000000);
|
||||
if (type === "nogif" && this.constructor.requiresGIF) return "That isn't a GIF!";
|
||||
return {
|
||||
file: Buffer.from(buffer.data),
|
||||
name: `${this.constructor.command}.${type}`
|
||||
};
|
||||
} catch (e) {
|
||||
if (e === "Job timed out") return "The image is taking too long to process (>=15 minutes), so the job was cancelled. Try using a smaller image.";
|
||||
if (e === "Job timed out" || e === "Timeout") return "The image is taking too long to process (>=15 minutes), so the job was cancelled. Try using a smaller image.";
|
||||
if (e.toString().includes("Not connected to image server") || e === "No available servers") return "I can't seem to contact the image servers, they might be down or still trying to start up. Please wait a little bit.";
|
||||
throw e;
|
||||
} finally {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue