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

refactor(ThreadManager)!: match parent ID when fetching a single thread #10557

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

imnaiyar
Copy link
Contributor

@imnaiyar imnaiyar commented Oct 13, 2024

Please describe the changes this PR makes and why it should be merged:
Currently as it stands, when fetching a single thread, discord.js simply returns ChannelManager#fetch, so ideally, one can fetch any channel of a guild, not just a thread in the channel of the manager, this is misleading as the docs state the return type to be a ThreadChannel (or equivalent). This pr adds in a check to match the parent id of the returned channel with the id of manager's channel and throws an error if it doesn't match. It also makes sense to have it this way, as one would expect to only get a thread of the channel the manager is of, similar to how fetchActive (and others) do.

I don't think it's breaking in any way as it doesn't change the return type or anything, just adds in a way to ensure it returns a thread of the parent channel.

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

@imnaiyar imnaiyar requested a review from a team as a code owner October 13, 2024 14:23
Copy link

vercel bot commented Oct 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
discord-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 10:57am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Nov 5, 2024 10:57am

Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

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

Unfortunately sem major :(

@didinele didinele changed the title fix(ThreadManager): match parent ID when fetching a single thread refactor(ThreadManager)!: match parent ID when fetching a single thread Nov 5, 2024
@didinele didinele merged commit 1184b38 into discordjs:main Nov 5, 2024
9 checks passed
@imnaiyar imnaiyar deleted the fix/threads-fetch branch November 5, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants