<commit_before>/**
*@function {fetchSongData} fetching data from the video to play it
*@function {checkGuildVC} Check if the bot connects to a voice channel in the guild
*/

const fetchSongData = require('../functions/music/fetchSongData.js');
const checkGuildVC = require('../functions/music/checkGuildVC.js');
const pushSongs = require('../functions/music/pushSongs.js');
// const InfoFetcher = require('youtube-info');
// const moment = require('moment');
// const Discord = require('discord.js')
exports.run = async (client,msg,args) => {
  msg.delete();
  let searchTerms = args.join(' ');
  let videoId = await fetchSongData(client, msg, searchTerms);
  if (!msg.member.voiceChannel) {
    return msg.reply('You must be in a voiceChannel');
  }
  if (videoId) {
    await pushSongs(msg, videoId);
    await checkGuildVC(client, msg);
    // let yInfo = await InfoFetcher(videoId);
    // console.log(yInfo);
    // const embed = new Discord.RichEmbed()
    // .setThumbnail(videoId.thumbnailUrl)
    // .addField('Song Info', `**Uploaded By:** ${videoId.owner}\n**Duration:** ${moment(videoId.duration).format('mm:ss')}`)
  } else {
    return;
  }
};

exports.help = {
    category: 'music',
    usage: '[Link or Term]',
    description: 'Play music',
    detail: 'Play music while you are in a voicechannel',
    botPerm    : ['SEND_MESSAGES', 'EMBED_LINKS', 'CONNECT', 'SPEAK', 'USE_VAD'],
    authorPerm : [],<commit_msg>Added some info<commit_after>/**
*@function {fetchSongData} fetching data from the video to play it
*@function {checkGuildVC} Check if the bot connects to a voice channel in the guild
*/

const fetchSongData = require('../functions/music/fetchSongData.js');
const checkGuildVC = require('../functions/music/checkGuildVC.js');
const pushSongs = require('../functions/music/pushSongs.js');
const InfoFetcher = require('youtube-info');
const moment = require('moment');
const Discord = require('discord.js')
exports.run = async (client,msg,args) => {
  msg.delete();
  let searchTerms = args.join(' ');
  let videoId = await fetchSongData(client, msg, searchTerms);
  if (!msg.member.voiceChannel) {
    return msg.reply('You must be in a voiceChannel');
  }
  if (videoId) {
    await pushSongs(msg, videoId);
    await checkGuildVC(client, msg);
    let yInfo = await InfoFetcher(videoId);
    const embed = new Discord.RichEmbed()
    .setThumbnail(yInfo.thumbnailUrl)
    .addField('Song Info', `**Uploaded By:** ${yInfo.owner}\n**Duration:** ${(yInfo.duration / 60).toFixed}\n**Views:** ${yInfo.views}`);
    msg.channel.send({embed})
  } else {
    return;
  }
};

exports.help = {
    category: 'music',
    usage: '[Link or Term]',
    description: 'Play music',
    detail: 'Play music while you are in a voicechannel',
    botPerm    : ['SEND_MESSAGES', 'EMBED_LINKS', 'CONNECT', 'SPEAK', 'USE_VAD'],
    authorPerm : [],
{'fraction_non_alphanumeric': 0.16334382651276672, 'fraction_numerical': 0.0006995452955578874, 'mean_word_length': 4.125448028673835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3988006', 'n_tokens_mistral': 947, 'n_tokens_neox': 923, 'n_words': 238}