Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(RoleManager): bug in #create #5730

Merged
merged 4 commits into from Jun 5, 2021
Merged

fix(RoleManager): bug in #create #5730

merged 4 commits into from Jun 5, 2021

Conversation

abdulrahman1s
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
if (permissions) is really bad idea, because somehow passing 0n or falsy value. it will be directly passed to api
That resulting an error: TypeError: Do not know how to serialize a BigInt

RoleManager#create({
   name: 'role-name',
   permissions: 0n
}) // -> TypeError: Do not know how to serialize a BigInt

Status and versioning classification:

  • Typings don't need updating

src/managers/RoleManager.js Outdated Show resolved Hide resolved
Co-authored-by: ckohen <chaikohen@gmail.com>
src/managers/RoleManager.js Outdated Show resolved Hide resolved
@vaporoxx
Copy link
Contributor

vaporoxx commented Jun 2, 2021

I disagree that permissions should be sent when not provided, because 0 is actually not the default.

Taken from the API docs:
image

And testing it also yields the same result:
image

@abdulrahman1s
Copy link
Contributor Author

I disagree that permissions should be sent when not provided, because 0 is actually not the default.

Taken from the API docs:
image

And testing it also yields the same result:
image

typeof x !== 'undefined' It looks better in this case.

@iCrawl iCrawl merged commit cf22456 into discordjs:master Jun 5, 2021
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants