avamaxboobs
Version:
A package for randomly selecting images of various people's boobs. Intended to be used for discord bot commands.
49 lines (47 loc) • 2.1 kB
JavaScript
const fs =require('fs');
const path = require('path');
/**
* Get a random picture of Ava Max's boobs 😳
* @param {boolean} braless Whether or not only braless images should be used. Defaults to false
* @param {boolean} topless Whether or not only topless images should be used. Defaults to false
* @returns {Promise<string>} random picture of Ava Max's boobs 😳
* @example const avamaxboob = await avamaxboobs(true)
*/
async function avamaxboobs(braless=false, topless=false){
if(typeof braless!='boolean' ||braless===null){
throw new Error('Oi dipshit, braless must be a boolean!')
}
if(typeof topless!='boolean' || topless===null){
throw new Error('Oi dipshit, topless must be a boolean!')
}else{
let file;
let json;
let avamaxboob;
if(!braless){
if(!topless){
file = fs.readFileSync(path.join(__dirname.slice(0,__dirname.length-21),'lists','avamaxboobs.json'));
json = JSON.parse(file);
avamaxboob = json.avamaxboobs[Math.floor(Math.random()*json.avamaxboobs.length)];
}else{
file = fs.readFileSync(path.join(__dirname.slice(0,__dirname.length-21),'lists','toplessavamax.json'));
json = JSON.parse(file);
avamaxboob = json.toplessavamax[Math.floor(Math.random()*json.toplessavamax.length)];
}
}
if(braless){
if(!topless){
file = fs.readFileSync(path.join(__dirname.slice(0,__dirname.length-21),'lists','bralessavamax.json'));
json = JSON.parse(file);
avamaxboob = json.bralessavamax[Math.floor(Math.random()*json.bralessavamax.length)];
}else{
file = fs.readFileSync(path.join(__dirname.slice(0,__dirname.length-21),'lists','toplessavamax.json'));
json = JSON.parse(file);
avamaxboob = json.toplessavamax[Math.floor(Math.random()*json.toplessavamax.length)];
}
}
return avamaxboob;
}
}
module.exports={
avamaxboobs
}