From f981b51247c9aaef0774e820c12fd0f8bc7d6613 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sun, 13 Oct 2019 18:15:56 +0200 Subject: [PATCH] loading message --- commands/images/autocrop.js | 3 +++ commands/images/jpegify.js | 3 +++ commands/images/mirror.js | 2 ++ commands/images/rotate.js | 2 ++ 4 files changed, 10 insertions(+) diff --git a/commands/images/autocrop.js b/commands/images/autocrop.js index f8285dc0..657e0c41 100644 --- a/commands/images/autocrop.js +++ b/commands/images/autocrop.js @@ -32,6 +32,8 @@ class autocropCommand extends Command { url = Attachment[0].url; } + let loadingmsg = await message.channel.send('Processing '); + jimp.read({ url: url @@ -42,6 +44,7 @@ class autocropCommand extends Command { .write(output); }) .then(() => { + loadingmsg.delete(); return message.channel.send({files: [output]}); }); diff --git a/commands/images/jpegify.js b/commands/images/jpegify.js index f5764a85..88d21263 100644 --- a/commands/images/jpegify.js +++ b/commands/images/jpegify.js @@ -32,6 +32,8 @@ class jpegifyCommand extends Command { url = Attachment[0].url; } + let loadingmsg = await message.channel.send('Processing '); + jimp.read({ url: url }) @@ -41,6 +43,7 @@ class jpegifyCommand extends Command { .write(output); }) .then(() => { + loadingmsg.delete(); return message.channel.send({files: [output]}); }); diff --git a/commands/images/mirror.js b/commands/images/mirror.js index 8e1541eb..864db411 100644 --- a/commands/images/mirror.js +++ b/commands/images/mirror.js @@ -32,6 +32,7 @@ class mirrorCommand extends Command { url = Attachment[0].url; } + let loadingmsg = await message.channel.send('Processing '); jimp.read({ url: url @@ -42,6 +43,7 @@ class mirrorCommand extends Command { .write(output); }) .then(() => { + loadingmsg.delete(); return message.channel.send({files: [output]}); }); diff --git a/commands/images/rotate.js b/commands/images/rotate.js index 00b6fbe6..07562bff 100644 --- a/commands/images/rotate.js +++ b/commands/images/rotate.js @@ -36,6 +36,7 @@ class rotateCommand extends Command { url = Attachment[0].url; } + let loadingmsg = await message.channel.send('Processing '); jimp.read({ url: url @@ -46,6 +47,7 @@ class rotateCommand extends Command { .write(output); }) .then(() => { + loadingmsg.delete(); return message.channel.send({files: [output]}); });