add various info

This commit is contained in:
loicbersier 2019-10-27 23:03:54 +01:00
parent 8a7b12d00d
commit 6277ea41bf

View file

@ -3,6 +3,7 @@ const YTPGenerator = require('ytpplus-node');
const os = require('os'); const os = require('os');
const fs = require('fs'); const fs = require('fs');
const youtubedl = require('youtube-dl'); const youtubedl = require('youtube-dl');
const { prefix } = require('../../config.json');
class ytpCommand extends Command { class ytpCommand extends Command {
constructor() { constructor() {
@ -45,8 +46,9 @@ class ytpCommand extends Command {
loadingmsg.delete(); loadingmsg.delete();
return message.channel.send('An error has occured, I can\'t download from the link you provided.'); return message.channel.send('An error has occured, I can\'t download from the link you provided.');
} else { } else {
let length = fs.readdirSync('./asset/ytp/userVid/').length;
loadingmsg.delete(); loadingmsg.delete();
return message.reply('Video sucessfully added to the pool!'); return message.reply(`Video sucessfully added to the pool! There is now ${length} videos`);
} }
}); });
} else { } else {
@ -56,7 +58,7 @@ class ytpCommand extends Command {
} }
if (!message.channel.nsfw) return message.channel.send('Please execute this command in an NSFW channel ( Content might not be NSFW but since the video are user submitted better safe than sorry )'); if (!message.channel.nsfw) return message.channel.send('Please execute this command in an NSFW channel ( Content might not be NSFW but since the video are user submitted better safe than sorry )');
let loadingmsg = await message.channel.send('Processing, this can take a **long** time, i\'ll ping you when i finished <a:loadingmin:527579785212329984>'); let loadingmsg = await message.channel.send(`Processing, this can take a **long** time, i'll ping you when i finished <a:loadingmin:527579785212329984>\nSome info: There is currently ${fs.readdirSync('./asset/ytp/userVid/').length} videos, you can add yours by doing \`\`${prefix[0]} ytp --add (link or attachment)\`\``);
// Read userVid folder and only take .mp4 // Read userVid folder and only take .mp4
let asset = []; let asset = [];