mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-05 10:22:31 +01:00
Committed the wrong rights script
This commit is contained in:
parent
c1d59c6298
commit
170d048db2
@ -1,40 +0,0 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const { env } = require("process");
|
||||
const { execSync } = require("child_process");
|
||||
const { argv, stdout, exit } = require("process");
|
||||
|
||||
const { execIn, getLines, parts } = require("../../util");
|
||||
|
||||
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());
|
||||
|
||||
function BitFlag(int) {
|
||||
return 1n << BigInt(int);
|
||||
}
|
||||
|
||||
let rights = [];
|
||||
let maxRights = 0n;
|
||||
lines4.forEach((x) => {
|
||||
maxRights += eval(`rights.${x.replace(":", " = ").replace(",", ";")}`);
|
||||
});
|
||||
//max rights...
|
||||
console.log(`Maximum rights: ${maxRights}`);
|
||||
//discord rights...
|
||||
discordRights = maxRights;
|
||||
discordRights -= rights.SEND_BACKDATED_EVENTS;
|
||||
discordRights -= rights.MANAGE_GUILD_DIRECTORY;
|
||||
discordRights -= rights.CREDITABLE;
|
||||
discordRights -= rights.BYPASS_RATE_LIMITS;
|
||||
discordRights -= rights.ADD_MEMBERS;
|
||||
discordRights -= rights.MANAGE_USERS;
|
||||
discordRights -= rights.MANAGE_TICKETS;
|
||||
discordRights -= rights.MANAGE_ROUTING;
|
||||
discordRights -= rights.MANAGE_RATE_LIMITS;
|
||||
discordRights -= rights.MANAGE_MESSAGES;
|
||||
discordRights -= rights.MANAGE_GUILDS;
|
||||
discordRights -= rights.MANAGE_APPLICATIONS;
|
||||
discordRights -= rights.OPERATOR;
|
||||
console.log(`Discord-like rights: ${discordRights}`);
|
20
util/scripts/rights.js
Normal file
20
util/scripts/rights.js
Normal file
@ -0,0 +1,20 @@
|
||||
const { Rights } = require("..");
|
||||
|
||||
const allRights = new Rights(1).bitfield;
|
||||
console.log(`All rights:`, allRights);
|
||||
|
||||
var discordLike = allRights;
|
||||
discordLike -= Rights.FLAGS.OPERATOR;
|
||||
discordLike -= Rights.FLAGS.MANAGE_APPLICATIONS;
|
||||
discordLike -= Rights.FLAGS.MANAGE_GUILDS;
|
||||
discordLike -= Rights.FLAGS.MANAGE_MESSAGES;
|
||||
discordLike -= Rights.FLAGS.MANAGE_RATE_LIMITS;
|
||||
discordLike -= Rights.FLAGS.MANAGE_ROUTING;
|
||||
discordLike -= Rights.FLAGS.MANAGE_TICKETS;
|
||||
discordLike -= Rights.FLAGS.MANAGE_USERS;
|
||||
discordLike -= Rights.FLAGS.ADD_MEMBERS;
|
||||
discordLike -= Rights.FLAGS.BYPASS_RATE_LIMITS;
|
||||
discordLike -= Rights.FLAGS.CREDITABLE;
|
||||
discordLike -= Rights.FLAGS.MANAGE_GUILD_DIRECTORY;
|
||||
discordLike -= Rights.FLAGS.SEND_BACKDATED_EVENTS;
|
||||
console.log(`Discord.com-like rights:`, discordLike);
|
Loading…
Reference in New Issue
Block a user