Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

types: remove newMessage partial on messageUpdate event typing #10526

Merged
merged 4 commits into from
Oct 6, 2024
Merged

types: remove newMessage partial on messageUpdate event typing #10526

merged 4 commits into from
Oct 6, 2024

Conversation

Amgelo563
Copy link
Contributor

@Amgelo563 Amgelo563 commented Sep 30, 2024

Please describe the changes this PR makes and why it should be merged:
According to discord/discord-api-docs#7017 the message update payload is no longer a partial object, but rather the full message object. As such, the ClientEvents#messageUpdate's newMessage shouldn't be typed as a partial anymore, which is what this PR modifies.

It also applies the OmitPartialGroupDMChannel generic to both messages, since this event won't be triggered from group DMs.

Closes #10525.

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

@Amgelo563 Amgelo563 requested a review from a team as a code owner September 30, 2024 15:12
Copy link

vercel bot commented Sep 30, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Oct 6, 2024 2:20pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Oct 6, 2024 2:20pm

@imnaiyar
Copy link
Contributor

imnaiyar commented Sep 30, 2024

Since this pr updates the message related event types, I think we can go ahead and also refactor it to omit PartialGroupDMChannel (as it is for it's sister counterparts) using OmitPartialGroupDMChannel as this event will never be fired from a group dm (I wonder why that wasn't done already 🤔)

@Amgelo563
Copy link
Contributor Author

You're right, not sure how I missed that, thanks!

@Amgelo563
Copy link
Contributor Author

Rebased with master.

@kodiakhq kodiakhq bot merged commit bb04e09 into discordjs:main Oct 6, 2024
7 checks passed
@Amgelo563 Amgelo563 deleted the feat/message-update-not-partial branch October 6, 2024 20:44
Jiralite pushed a commit that referenced this pull request Oct 9, 2024
* types: remove newMessage partial on messageUpdate event typing

* types: omit partial group DM for newMessage on messageUpdate

* types: omit partial group DM for oldMessage on messageUpdate

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Message updates new message shouldn't be partial
6 participants