Skip to content

Commit

Permalink
Fix Admin Permission Check
Browse files Browse the repository at this point in the history
  • Loading branch information
IanMitchell committed Jun 24, 2024
1 parent 0a5b181 commit 0238568
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-gorillas-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"discord-bitflag": patch
---

Fixes a bug checking the admin permission
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},

"files.insertFinalNewline": true,
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/discord-bitflag/src/wrappers/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class PermissionsBitField extends BitField {
static ALL = BitField.resolve(Object.values(PermissionFlags));

has(...flags: BitFlagResolvable[]) {
return super.has(flags, PermissionFlags.Administrator);
return super.has(flags) || super.has(PermissionFlags.Administrator);
}

hasWithoutAdmin(...flags: BitFlagResolvable[]) {
Expand Down

0 comments on commit 0238568

Please sign in to comment.