From d78b3a1e62c2c5776eddd1a053fc0e149247e3e3 Mon Sep 17 00:00:00 2001 From: supositware Date: Tue, 16 Mar 2021 15:25:55 +0100 Subject: [PATCH] Fix command --- commands/owner/removeytp.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/owner/removeytp.js b/commands/owner/removeytp.js index c817812..5edaed0 100644 --- a/commands/owner/removeytp.js +++ b/commands/owner/removeytp.js @@ -27,14 +27,15 @@ class removeytpCommand extends Command { } async exec(message, args) { - const hash = md5File.sync(args.filePath); + let filepath = `./asset/ytp/userVid/${args.messageID}.mp4`; + const hash = md5File.sync(filepath); const ytphash = await ytpHash.findOne({where: {hash: hash}}); if (ytphash) { await ytpHash.destroy({where: {hash: hash}}); } - fs.unlinkSync(`./asset/ytp/userVid/${args.messageID}.mp4`); + fs.unlinkSync(filepath); return message.channel.send('Successfully removed the video.'); } }