Skip to content

Conversation

@Jiralite
Copy link
Member

Please describe the changes this PR makes and why it should be merged:
Resolves #10294.

Simply put: if there's no message id, throw ErrorCodes.MessageReferenceMissing.

Also, the JSDoc had these properties as ?. ? does not indicate undefined—it indicates <type> | null.1

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

Footnotes

  1. https://jsdoc.app/tags-type

@vercel
Copy link

vercel bot commented May 21, 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 May 24, 2024 1:07pm
discord-js-guide ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 1:07pm

@Jiralite Jiralite changed the title docs(MessageReference): ? is nullable, not undefined fix: Throw error on no message id for Message#fetchReferece() May 21, 2024
@Jiralite Jiralite changed the title fix: Throw error on no message id for Message#fetchReferece() fix: Throw error on no message id for Message#fetchReference() May 21, 2024
@codecov
Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 1.83%. Comparing base (27d0659) to head (2f315b0).

Additional details and impacted files
@@            Coverage Diff            @@
##            main   #10295      +/-   ##
=========================================
+ Coverage   1.42%    1.83%   +0.41%     
=========================================
  Files         64      117      +53     
  Lines       3238     4912    +1674     
  Branches      64       71       +7     
=========================================
+ Hits          46       90      +44     
- Misses      3192     4822    +1630     
Flag Coverage Δ
brokers 1.83% <ø> (+0.41%) ⬆️
builders 1.83% <ø> (+0.41%) ⬆️
collection 1.83% <ø> (+0.41%) ⬆️
discord.js 1.83% <ø> (+0.41%) ⬆️
formatters 1.83% <ø> (+0.41%) ⬆️
guide 1.83% <ø> (+0.41%) ⬆️
next 1.83% <ø> (+0.41%) ⬆️
proxy 1.83% <ø> (+0.41%) ⬆️
rest 1.83% <ø> (+0.41%) ⬆️
util 1.83% <ø> (+0.41%) ⬆️
utilities 1.83% <ø> (+0.41%) ⬆️
voice 1.83% <ø> (+0.41%) ⬆️
website 1.83% <ø> (+0.41%) ⬆️
ws 1.83% <ø> (+0.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Message#fetchReference() returns a non-message on certain message types

6 participants