/* eslint-disable max-len */ const profanityNames = ['Eagler', 'Eagler', 'Bitch', 'Cock', 'Milf', 'Milf', 'Yeer', 'Groon', 'Eag', 'Deevis', 'Chode', 'Deev', 'Deev', 'Fucker', 'Fucking', 'Dumpster', 'Dumpster', 'Cum', 'Chad', 'Egg', 'Fudgler', 'Fudgli', 'Yee', 'Yee', 'Yee', 'Yeet', 'Flumpter', 'Darvy', 'Darver', 'Darver', 'Fuck', 'Fuck', 'Frick', 'Eagler', 'Vigg', 'Vigg', 'Cunt', 'Darvig', ]; const names = ['Yeeish', 'Yeeish', 'Yee', 'Yee', 'Yeer', 'Yeeler', 'Eagler', 'Eagl', 'Darver', 'Darvler', 'Vool', 'Vigg', 'Vigg', 'Deev', 'Yigg', 'Yeeg']; /** * gets a random item in an array * @param {Array} arr the array * @return {*} the item in the array */ function getRandomItem(arr) { const randomIndex = Math.floor(Math.random() * arr.length); const item = arr[randomIndex]; return item; } /** * generates an eaglercraft username (totally not converted from the eaglercraft repo) * @param {boolean} profanity bad words. * @return {String} the output of the generated eagler username */ function genUsername(profanity) { let username; if (profanity) { username = getRandomItem(profanityNames) + getRandomItem(profanityNames) + (10 + Math.floor(Math.random() * 90)); } else { username = getRandomItem(names) + getRandomItem(names) + (10 + Math.floor(Math.random() * 90)); } return username; } module.exports = genUsername;