diff options
Diffstat (limited to 'scripts/rights.js')
-rw-r--r-- | scripts/rights.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/rights.js b/scripts/rights.js index 20fd139c..5ae576ef 100644 --- a/scripts/rights.js +++ b/scripts/rights.js @@ -6,20 +6,20 @@ const { argv, stdout, exit } = require("process"); const { execIn, getLines, parts } = require("./utils"); -let lines = fs.readFileSync(path.join(__dirname, "..", "src", "util", "util","Rights.ts")).toString() +let lines = fs.readFileSync(path.join(__dirname, "..", "src", "util", "util", "Rights.ts")).toString(); let lines2 = lines.split("\n"); -let lines3 = lines2.filter(y=>y.includes(": BitFlag(")); -let lines4 = lines3.map(x=>x.split("//")[0].trim()) +let lines3 = lines2.filter((y) => y.includes(": BitFlag(")); +let lines4 = lines3.map((x) => x.split("//")[0].trim()); function BitFlag(int) { - return 1n << eval(`${int}n`); + return 1n << BigInt(int); } -let rights = [] +let rights = []; let maxRights = 0n; -lines4.forEach(x=>{ - maxRights += eval(`rights.${x.replace(':'," = ").replace(",",";")}`) -}) +lines4.forEach((x) => { + maxRights += eval(`rights.${x.replace(":", " = ").replace(",", ";")}`); +}); //max rights... console.log(`Maximum rights: ${maxRights}`); //discord rights... @@ -31,4 +31,4 @@ discordRights -= rights.BYPASS_RATE_LIMITS; discordRights -= rights.ADD_MEMBERS; discordRights -= rights.MANAGE_RATE_LIMITS; discordRights -= rights.OPERATOR; -console.log(`Discord-like rights: ${discordRights}`); \ No newline at end of file +console.log(`Discord-like rights: ${discordRights}`); |