chomens-bot-js/util/generateEaglerUsername.js

39 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-08-16 06:05:15 -04:00
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',
2022-11-27 02:35:28 -05:00
'Fuck', 'Fuck', 'Frick', 'Eagler', 'Vigg', 'Vigg', 'Cunt', 'Darvig'
]
2022-08-16 06:05:15 -04:00
const names = ['Yeeish', 'Yeeish', 'Yee', 'Yee', 'Yeer', 'Yeeler', 'Eagler', 'Eagl',
2022-11-27 02:35:28 -05:00
'Darver', 'Darvler', 'Vool', 'Vigg', 'Vigg', 'Deev', 'Yigg', 'Yeeg']
2022-08-15 09:15:06 -04:00
2022-11-15 21:33:16 -05:00
/**
* gets a random item in an array
* @param {Array} arr the array
* @return {*} the item in the array
*/
2022-11-27 02:35:28 -05:00
function getRandomItem (arr) {
const randomIndex = Math.floor(Math.random() * arr.length)
const item = arr[randomIndex]
2022-08-15 09:15:06 -04:00
2022-11-27 02:35:28 -05:00
return item
2022-08-15 09:15:06 -04:00
}
2022-11-15 21:33:16 -05:00
/**
* 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
*/
2022-11-27 02:35:28 -05:00
function genUsername (profanity) {
let username
2022-08-16 06:05:15 -04:00
if (profanity) {
2022-11-27 02:35:28 -05:00
username = getRandomItem(profanityNames) + getRandomItem(profanityNames) + (10 + Math.floor(Math.random() * 90))
2022-08-16 06:05:15 -04:00
} else {
2022-11-27 02:35:28 -05:00
username = getRandomItem(names) + getRandomItem(names) + (10 + Math.floor(Math.random() * 90))
2022-08-16 06:05:15 -04:00
}
2022-08-15 09:15:06 -04:00
2022-11-27 02:35:28 -05:00
return username
2022-08-15 09:46:04 -04:00
}
2022-11-27 02:35:28 -05:00
module.exports = genUsername