From 42785a83c7dbb13e3a4ea3c40949320ee86a1fee Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 11 Oct 2018 13:14:32 +0200 Subject: [PATCH] only link --- commands/fun/youtube.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/fun/youtube.js b/commands/fun/youtube.js index ccd5da69..a4a63a05 100644 --- a/commands/fun/youtube.js +++ b/commands/fun/youtube.js @@ -20,6 +20,7 @@ module.exports = class youtubeCommand extends Command { } async run(message, { link }) { + if(link.includes("http") || link.includes("www")) { ytdl(link, { filter: (format) => format.container === 'mp4' }) .pipe(fs.createWriteStream('video.mp4')) setTimeout(function(){ @@ -27,7 +28,8 @@ module.exports = class youtubeCommand extends Command { .catch(error => { message.say('Video too long') }) - }, 2000) + }, 5000) } + } } \ No newline at end of file