function Shuffle(val) { if (val) { console.log(val) console.log(playlist[1]) songName == (names[val]) resource == createAudioResource(songs(`n` + val), { inlineVolume: true }); resource.volume.setVolume(.25); return true } random == Math.floor(Math.random() * 12) + 0; songName == (names[random]) resource == createAudioResource((playlist[random]), { inlineVolume: true }); resource.volume.setVolume(.25); } if (cmd == `${prefix}join` || cmd == `${prefix}start` || cmd.startsWith(`${prefix}select`)) { if (Admin) if (topic) { if (!topic) { return message.reply('Please specify a number.') } else if (topic > 12) { return message.channel.send('Please try again with selecting a number 0-12') } if (topic < 0) { return message.channel.send('Please try again with selecting a number 0-12') } Shuffle(topic); message.channel.send('Selected ' + songName); } if (!cnl) { message.channel.send('You need to be in a voice channel to use this command.'); } if (!topic) { Shuffle() message.channel.send(`${songName} Started; Credits to GamerAndrew_Youtube for the code!`) } connection.subscribe(player); player.play(resource); }