UNPKG

nidhishpackage

Version:

This is a fun package for [Discord](https://discord.com) The library is [Discord.js](https://discord.js.org)

29 lines (26 loc) 946 B
module.exports = ({ createID: (objL, IDList) => { objL = objL.filter(val => !IDList.includes(val.index)); objL = objL[Math.floor(objL.length * Math.random())].index; return objL; }, resizeMap: (mapObjects) => { mapObjects = mapObjects.map((obj) => obj.symbol); let output = []; while (mapObjects.length) { output.push(mapObjects.splice(0, 10).join("")); } return output; }, mixOptions: (options, defOptions) => { return Object.assign(defOptions, typeof options === "object" && !Array.isArray(options) ? options : {}); }, checkCoordinateObj: (coordinate) => { if (typeof coordinate === "object" && !Array.isArray(coordinate)) { if (coordinate.hasOwnProperty("x") && coordinate.hasOwnProperty("y")) { if (10 > coordinate.x && 10 > coordinate.y) return true; else return false; } else return false; } else return false; } })