From 8f31ca0880d0cd796f8295bd64be4dfbf03524a2 Mon Sep 17 00:00:00 2001 From: Supositware Date: Fri, 1 Mar 2019 19:36:12 +0100 Subject: [PATCH] delete nolight.png --- commands/images/nolight.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/images/nolight.js b/commands/images/nolight.js index 4bf8c7d4..336df95e 100644 --- a/commands/images/nolight.js +++ b/commands/images/nolight.js @@ -55,7 +55,7 @@ class nolightCommand extends Command { ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); ctx.font = applyText(canvas, text); ctx.fillStyle = '#FFFFFF'; - ctx.fillText(text, canvas.width / 10, canvas.height / 9.8); + ctx.fillText(text, canvas.width / 10, canvas.height / 9); fs.writeFile('./img/frame001.png', canvas.toBuffer(), function (err) { if (err) { @@ -64,13 +64,15 @@ class nolightCommand extends Command { }); async function apng() { + fs.unlink('./img/nolight.png', (err) => { + if (err) throw err; + }); const { stdout, stderr } = await exec('apngasm -o img/nolight.png img/frame00*.png -s') .then(() => message.channel.send({files: ['./img/nolight.png']})); console.log(`stdout: ${stdout}`); console.log(`stderr: ${stderr}`); } apng(); - return; } }