Renamed youtube to download

This commit is contained in:
Loïc Bersier 2018-11-18 18:04:13 +01:00
parent cab5fee489
commit 4a57d208fa

View file

@ -4,12 +4,12 @@ const youtubedl = require('youtube-dl');
const blacklist = require('../../json/blacklist.json'); const blacklist = require('../../json/blacklist.json');
const { fbuser, fbpasswd } = require('../../config.json'); const { fbuser, fbpasswd } = require('../../config.json');
module.exports = class youtubeCommand extends Command { module.exports = class downloadCommand extends Command {
constructor(client) { constructor(client) {
super(client, { super(client, {
name: 'youtube', name: 'download',
group: 'utility', group: 'utility',
memberName: 'youtube', memberName: 'download',
description: `Download any video from the link you provided.`, description: `Download any video from the link you provided.`,
args: [ args: [
{ {
@ -30,6 +30,8 @@ module.exports = class youtubeCommand extends Command {
let video = youtubedl(link, [`--username=${fbuser}`,`--password=${fbpasswd}`]) let video = youtubedl(link, [`--username=${fbuser}`,`--password=${fbpasswd}`])
video.pipe(fs.createWriteStream('video.mp4')) video.pipe(fs.createWriteStream('video.mp4'))
video.on('end', function() { video.on('end', function() {
message.delete();
message.delete();
message.channel.send({files: ["./video.mp4"]}) message.channel.send({files: ["./video.mp4"]})
.catch(error => message.say('An error has occured, the file might be too big or i cant download the link you provided')) .catch(error => message.say('An error has occured, the file might be too big or i cant download the link you provided'))
}) })