webm override

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-07-26 13:59:25 +02:00
parent 0fb57f7243
commit e7f1d491cd

View file

@ -17,6 +17,11 @@ class cursesCommand extends Command {
id: 'link', id: 'link',
type: 'url', type: 'url',
}, },
{
id: 'webm',
match: 'flag',
flag: ['--webm']
},
], ],
description: { description: {
content: 'Mess with video length. webm = expanding length and mp4 = very long length', content: 'Mess with video length. webm = expanding length and mp4 = very long length',
@ -38,9 +43,11 @@ class cursesCommand extends Command {
link = await attachment(message); link = await attachment(message);
let ext = path.extname(link.toLowerCase()); let ext = path.extname(link.toLowerCase());
if (ext !== '.webm' || ext !== '.mp4') { if (ext !== '.webm' || ext !== '.mp4')
ext = '.mp4'; ext = '.mp4';
}
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, null, `${os.tmpdir()}/${message.id}${ext}`)