delete author message and fix webm flag

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-07-26 14:04:22 +02:00
parent e7f1d491cd
commit cdab95811c

View file

@ -50,7 +50,7 @@ class cursesCommand extends Command {
if (args.webm) ext = '.webm'; if (args.webm) ext = '.webm';
let loadingmsg = await message.channel.send('Processing <a:loadingmin:527579785212329984>'); let loadingmsg = await message.channel.send('Processing <a:loadingmin:527579785212329984>');
downloader(link, null, `${os.tmpdir()}/${message.id}${ext}`) downloader(link, [`--format=${ext.replace('.', '')}`], `${os.tmpdir()}/${message.id}${ext}`)
.on('error', async err => { .on('error', async err => {
loadingmsg.delete(); loadingmsg.delete();
console.error(err); console.error(err);
@ -76,6 +76,7 @@ class cursesCommand extends Command {
} }
fs.writeFileSync(`${os.tmpdir()}/cursed${message.id}${ext}`, Buffer.from(endResult, 'hex')); fs.writeFileSync(`${os.tmpdir()}/cursed${message.id}${ext}`, Buffer.from(endResult, 'hex'));
message.delete();
return message.channel.send(`Cursed by ${message.author}`, {files: [`${os.tmpdir()}/cursed${message.id}${ext}`]}) return message.channel.send(`Cursed by ${message.author}`, {files: [`${os.tmpdir()}/cursed${message.id}${ext}`]})
.catch(err => { .catch(err => {
console.error(err); console.error(err);