Comparing version 4.15.1 to 4.15.2
@@ -23,4 +23,4 @@ /** @format */ | ||
commands(): import("@discordjs/collection").Collection<string, import("../main.js").XernerxSlashCommand> | import("@discordjs/collection").Collection<string, import("../main.js").XernerxContextCommand>; | ||
permissionCheck(type: 'user' | 'client', permissions: Array<PermissionNames>): boolean; | ||
permissionCheck(type: 'user' | 'client', permissions: Array<PermissionNames>, emit?: boolean): boolean | string[]; | ||
} | ||
export {}; |
@@ -128,3 +128,3 @@ /** @format */ | ||
} | ||
permissionCheck(type, permissions) { | ||
permissionCheck(type, permissions, emit = true) { | ||
console.log(type); | ||
@@ -141,4 +141,3 @@ const missing = []; | ||
const command = this.commands().toJSON().find((cmd) => cmd.name == this.parsed.alias?.split(/ +/)[0]); | ||
console.log(type); | ||
if (missing.length) { | ||
if (missing.length && emit) { | ||
this.client.emit(`commandBlock`, this.interaction, { | ||
@@ -152,2 +151,4 @@ reason: `missing${Style.pascalCase(type)}Permissions`, | ||
} | ||
else if (missing.length && !emit) | ||
return missing; | ||
else | ||
@@ -154,0 +155,0 @@ return true; |
@@ -24,4 +24,4 @@ /** @format */ | ||
commands(): import("@discordjs/collection").Collection<string, import("../main.js").XernerxMessageCommand>; | ||
permissionCheck(type: 'user' | 'client', permissions: Array<PermissionNames>): boolean; | ||
permissionCheck(type: 'user' | 'client', permissions: Array<PermissionNames>, emit?: boolean): boolean | string[]; | ||
} | ||
export {}; |
@@ -142,3 +142,3 @@ /** @format */ | ||
} | ||
permissionCheck(type, permissions) { | ||
permissionCheck(type, permissions, emit = true) { | ||
console.log(type); | ||
@@ -155,4 +155,3 @@ const missing = []; | ||
const command = this.commands().find((cmd) => cmd.name == this.parsed.alias || cmd.aliases?.includes(this.parsed.alias)); | ||
console.log(type); | ||
if (missing.length) { | ||
if (missing.length && emit) { | ||
this.client.emit(`commandBlock`, this.message, { | ||
@@ -166,2 +165,4 @@ reason: `missing${Style.pascalCase(type)}Permissions`, | ||
} | ||
else if (missing.length && !emit) | ||
return missing; | ||
else | ||
@@ -168,0 +169,0 @@ return true; |
{ | ||
"name": "xernerx", | ||
"version": "4.15.1", | ||
"version": "4.15.2", | ||
"description": "A bot framework for discord.js.", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
149378
3299
3