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(xxxable): follow more properly with discord behavior #6551

Merged
merged 9 commits into from Sep 23, 2021

Conversation

tignear
Copy link
Contributor

@tignear tignear commented Aug 29, 2021

Please describe the changes this PR makes and why it should be merged:
In rare cases, the result returned by the current XXXable property may not return the exact result, but it will return the correct result.
However, it seems difficult to maintain this, so consider removing this property.

  • Cannot delete channels that are not viewable/connectable(have CONNECT permission).
  • Cannot edit messages on channels that cannot send messages.
    • Cannot edit messages on channels that cannot view messages.
  • Cannot pin messages on channels that cannot view messages.
  • Cannot delete messages on channels that cannot view messages.
  • Messages that are not system messages can be pinned.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@tignear
Copy link
Contributor Author

tignear commented Aug 29, 2021

Which should I use permissionsFor().has(X) or permissionsFor().has(X,false)?
This is work as same(It seems that I was confused when I created f28178c).

Copy link
Contributor

@NotSugden NotSugden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GuildChannel#permissionsFor can return null if the member for the client user is uncached

src/structures/Message.js Outdated Show resolved Hide resolved
src/structures/Message.js Outdated Show resolved Hide resolved
src/structures/Message.js Outdated Show resolved Hide resolved
@tignear tignear force-pushed the fix/follow-discord branch 2 times, most recently from 0b6a55d to 1df5ac6 Compare August 30, 2021 07:51
src/structures/Message.js Outdated Show resolved Hide resolved
src/structures/Message.js Outdated Show resolved Hide resolved
src/structures/VoiceChannel.js Show resolved Hide resolved
@tignear
Copy link
Contributor Author

tignear commented Sep 8, 2021

@iCrawl iCrawl merged commit 5d87398 into discordjs:main Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants