mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
remove camelcase permission stuff
This commit is contained in:
parent
f4b4747d08
commit
afab564628
1 changed files with 1 additions and 8 deletions
|
@ -1,18 +1,11 @@
|
|||
import { Permissions } from "discord.js";
|
||||
|
||||
const camelCaseToTitleCase = str =>
|
||||
str
|
||||
.replace(/([a-z])([A-Z])/g, "$1 $2")
|
||||
.split(" ")
|
||||
.map(w => w[0].toUpperCase() + w.slice(1))
|
||||
.join(" ");
|
||||
|
||||
const permissionNumberToName: Map<bigint, string> = new Map();
|
||||
const ignoredPermissionConstants = ["all", "allGuild", "allText", "allVoice"];
|
||||
|
||||
for (const key in Permissions.FLAGS) {
|
||||
if (ignoredPermissionConstants.includes(key)) continue;
|
||||
permissionNumberToName.set(BigInt(Permissions.FLAGS[key]), camelCaseToTitleCase(key));
|
||||
permissionNumberToName.set(BigInt(Permissions.FLAGS[key]), key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue