From 863cb2c25ffa332ee4cc44f148352a1d0c650bb4 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 21 Feb 2020 21:19:46 +0100 Subject: [PATCH] Trying something else --- commands/images/meme.js | 4 ++-- commands/images/poster.js | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/commands/images/meme.js b/commands/images/meme.js index e27bcf65..e50985bb 100644 --- a/commands/images/meme.js +++ b/commands/images/meme.js @@ -60,11 +60,11 @@ class memeCommand extends Command { // Create new graphicsmagick instance fetch(url) .then(res => { - const dest = fs.createWriteStream(`${os.tmpdir()}/${message.id}.png`); + const dest = fs.createWriteStream(`${os.tmpdir()}/${message.id}.${url.split('.').pop()}`); res.body.pipe(dest); dest.on('finish', async () => { - let img = gm(`${os.tmpdir()}/${message.id}.png`); + let img = gm(`${os.tmpdir()}/${message.id}.${url.split('.').pop()}`); // Set some defaults const TOP_TEXT = options[0]; diff --git a/commands/images/poster.js b/commands/images/poster.js index 50cd149d..19e20c5e 100644 --- a/commands/images/poster.js +++ b/commands/images/poster.js @@ -77,12 +77,11 @@ class posterCommand extends Command { // Create new graphicsmagick instance fetch(url) .then(res => { - const dest = fs.createWriteStream(`${os.tmpdir()}/${message.id}.png`); + const dest = fs.createWriteStream(`${os.tmpdir()}/${message.id}.${url.split('.').pop()}`); res.body.pipe(dest); dest.on('finish', async () => { - let img = gm(`${os.tmpdir()}/${message.id}.png`); - + let img = gm(`${os.tmpdir()}/${message.id}.${url.split('.').pop()}`); // Set some defaults const TOP_TEXT = options[0]; const BOTTOM_TEXT = options[1];