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(Message): replace referencedMessage with fetchReference #5577

Merged
merged 3 commits into from May 10, 2021

Conversation

monbrey
Copy link
Member

@monbrey monbrey commented May 1, 2021

This replaces the cache-reliant Message#referencedMessage with a more reliable way to resolve the Message
This follows precedent set by #5480

The method with throw an error if Message#reference is null, or if the channel to fetch the message from is not in the client's cache, as is likely to be the case when the message is a crosspost rather than a reply.

This seemed like the best way to handle it without getting into raw APIs calls and partial channels and all that mess.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • This PR changes the library's interface (methods or parameters added)
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • I know how to update typings and have done so, or typings don't need updating

kyranet
kyranet previously requested changes May 1, 2021
src/structures/Message.js Outdated Show resolved Hide resolved
@iCrawl iCrawl merged commit 1398431 into discordjs:master May 10, 2021
@monbrey monbrey deleted the fetch-reference branch May 10, 2021 11:27
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
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

5 participants