-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Correctly mapping overwrites when creating a channel and renamed all relevant property names as of #1562 #1570
Conversation
and fixed `GuildChannel#clone`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops!
if (overwrites instanceof Collection) overwrites = overwrites.array(); | ||
if (overwrites instanceof Collection || overwrites instanceof Array) { | ||
overwrites = overwrites.map(overwrite => ({ | ||
allow: overwrite.allow || overwrite._allowed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.allowed
if (overwrites instanceof Collection || overwrites instanceof Array) { | ||
overwrites = overwrites.map(overwrite => ({ | ||
allow: overwrite.allow || overwrite._allowed, | ||
deny: overwrite.deny || overwrite._denied, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.denied
src/structures/GuildChannel.js
Outdated
permissions &= ~overwrites.everyone.deny; | ||
permissions |= overwrites.everyone.allow; | ||
permissions &= ~overwrites.everyone._denied; | ||
permissions |= overwrites.everyone._alloweded; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_alloweded => _allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice copy paste :^)
…relevant property names as of discordjs#1562 (discordjs#1570) * using correct properties to apply permissionOverwrites and fixed `GuildChannel#clone` * also arrays should be mapped and correct properties taking priority * changed .deny and .allow to .denied and .allowed respectively * whoops
Please describe the changes this PR makes and why it should be merged:
Since those two properties were renamed PermissionOverwrites require mapping before sending them to discord.
Changing the names of the properties back would be a better solution IMO.
Also passing now the overwrites as correct parameter when cloning a channel.
Edit:
Changed all
.deny
and.allow
for permission related methods inGuildChannel
to their new property names.Related to #1595's problem with
.joinable
being incorrectlytrue
.Semantic versioning classification: