only link

This commit is contained in:
loicbersier 2018-10-11 13:14:32 +02:00
parent c07739115a
commit 42785a83c7

View file

@ -20,6 +20,7 @@ module.exports = class youtubeCommand extends Command {
} }
async run(message, { link }) { async run(message, { link }) {
if(link.includes("http") || link.includes("www")) {
ytdl(link, { filter: (format) => format.container === 'mp4' }) ytdl(link, { filter: (format) => format.container === 'mp4' })
.pipe(fs.createWriteStream('video.mp4')) .pipe(fs.createWriteStream('video.mp4'))
setTimeout(function(){ setTimeout(function(){
@ -27,7 +28,8 @@ module.exports = class youtubeCommand extends Command {
.catch(error => { .catch(error => {
message.say('Video too long') message.say('Video too long')
}) })
}, 2000) }, 5000)
} }
}
} }