avamaxboobs
Version:
A package for randomly selecting images of various people's boobs. Intended to be used for discord bot commands.
32 lines (30 loc) • 1.38 kB
JavaScript
const fs =require('fs');
const path = require('path');
/**
* Get a random picture of Amanda Love's boobs 😳
* @param {boolean} withbra Whether or not only images of Amanda Love with a bra should be used. Defaults to false, meaning most of the returned images will be NSFW
* @returns {Promise<string>} random picture of Amanda Love's boobs 😳
* @example const amandaloveboob = await amandaloveboobs()
*/
async function amandaloveboobs(withbra=false){
if(typeof withbra!='boolean' || withbra===null){
throw new Error('Oi dipshit, withbra must be a boolean!')
}else{
if(!withbra){
const file = fs.readFileSync(path.join(__dirname.slice(0,__dirname.length-21),'lists','amandaloveboobs.json'));
const keys = Object.keys(JSON.parse(file.toString()))
const val = JSON.parse(file.toString())[keys]
const loveboob = val[Math.floor(Math.random()*val.length)];
return loveboob;
}
if(withbra){
const file = fs.readFileSync(path.join(__dirname.slice(0,__dirname.length-21),'lists','amandalovewithabra.json'));
const json = JSON.parse(file);
const amandalovewithabra = json.amandalovewithabra[Math.floor(Math.random()*json.amandalovewithabra.length)];
return amandalovewithabra;
}
}
}
module.exports={
amandaloveboobs
}