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 fetchOwner() method #6207

Merged
merged 7 commits into from Jul 31, 2021

Conversation

ImRodry
Copy link
Contributor

@ImRodry ImRodry commented Jul 28, 2021

Please describe the changes this PR makes and why it should be merged:
This PR adds a fetchOwner() method that returns the ThreadMember object corresponding to the Owner of the thread

Status and versioning classification:

  • 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)

@ImRodry ImRodry changed the title feat(ThreadChannel): add owner and fetchOwner() feat(ThreadChannel): add fetchOwner() method Jul 28, 2021
@iCrawl iCrawl added this to the Version 13 milestone Jul 29, 2021
src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
@ImRodry ImRodry requested a review from SpaceEEC July 29, 2021 10:33
src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
@ImRodry ImRodry requested a review from kyranet July 29, 2021 18:45
@Jiralite
Copy link
Member

I believe the current implementation of this always expects to return the owner, but this is not true. The owner can leave! This would make the return type possibly undefined - in this case, it should be null.

src/structures/ThreadChannel.js Outdated Show resolved Hide resolved
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
@iCrawl iCrawl merged commit 331a9d3 into discordjs:master Jul 31, 2021
@ImRodry ImRodry deleted the thread-fetchowner branch July 31, 2021 12:19
IRONM00N pushed a commit to TanzaniteBot/discord.js that referenced this pull request Aug 1, 2021
* feat(ThreadChannel): add owner and fetchOwner()

* fix(ThreadChannel): remove owner and return ThreadMember with fetchOwner

* fix(ThreadChannel): apply suggestions from code review

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>

* fix(ThreadChannel): correctly point to the manager

* docs(FetchOwnerOptions): update desc to mention threads

* fix(ThreadChannel): fetchOwner can return null

* docs(ThreadChannel): owner is nullable

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
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

6 participants