Trying something else

This commit is contained in:
loicbersier 2020-02-21 21:19:46 +01:00
parent 69c5cbbc36
commit 863cb2c25f
2 changed files with 4 additions and 5 deletions

View file

@ -60,11 +60,11 @@ class memeCommand extends Command {
// Create new graphicsmagick instance // Create new graphicsmagick instance
fetch(url) fetch(url)
.then(res => { .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); res.body.pipe(dest);
dest.on('finish', async () => { 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 // Set some defaults
const TOP_TEXT = options[0]; const TOP_TEXT = options[0];

View file

@ -77,12 +77,11 @@ class posterCommand extends Command {
// Create new graphicsmagick instance // Create new graphicsmagick instance
fetch(url) fetch(url)
.then(res => { .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); res.body.pipe(dest);
dest.on('finish', async () => { 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 // Set some defaults
const TOP_TEXT = options[0]; const TOP_TEXT = options[0];
const BOTTOM_TEXT = options[1]; const BOTTOM_TEXT = options[1];