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

feat(ThreadChannel): add ThreadChannel#viewable #6975

Merged
merged 2 commits into from Nov 18, 2021

Conversation

suneettipirneni
Copy link
Member

Please describe the changes this PR makes and why it should be merged:

Closes #6969

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
  • This PR changes the library's interface (methods or parameters added)

@suneettipirneni suneettipirneni changed the title feat: add ThreadChannel#viewable feat: add ThreadChannel#viewable Nov 12, 2021
@iCrawl iCrawl added this to the Version 13.4 milestone Nov 12, 2021
Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

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

Whilst this pull request does fix the issue linked, it doesn't fix all instances of it.

Consider the scenario where a thread becomes locked or the client fetches a thread that happens to be locked without the manage threads permission. Then, consider the client fetching a message and running Message#editable. Through that, the result will be true but it should be false because the thread is locked and messages cannot be edited.

@suneettipirneni
Copy link
Member Author

Whilst this pull request does fix the issue linked, it doesn't fix all instances of it.

Consider the scenario where a thread becomes locked or the client fetches a thread that happens to be locked without the manage threads permission. Then, consider the client fetching a message and running Message#editable. Through that, the result will be true but it should be false because the thread is locked and messages cannot be edited.

Good catch! I'm thinking even if it's locked and you have manage_threads perms editable should probably still be false, simply because the current state of the thread is still archived, and I believe editing a message doesn't implicitly unarchive it.

@Jiralite
Copy link
Member

I'm thinking even if it's locked and you have manage_threads perms editable should probably still be false

Right.

@suneettipirneni suneettipirneni changed the title feat: add ThreadChannel#viewable feat(ThreadChannel): add ThreadChannel#viewable Nov 12, 2021
@iCrawl iCrawl merged commit db09d79 into discordjs:main Nov 18, 2021
@suneettipirneni suneettipirneni deleted the feat/thread-viewable branch July 6, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Message.editable doesn't work in threads
5 participants