Skip to content

fix(PartialGroupDMChannel): Prevent undefined values #10889

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

Merged
merged 2 commits into from
May 7, 2025

Conversation

Jiralite
Copy link
Member

@Jiralite Jiralite commented May 7, 2025

Please describe the changes this PR makes and why it should be merged:
When fetching a group direct message invite, I encountered this:

image

icon and recipients were undefined. Looking at the specification, only id and type are definitely sent:

https://github.com/discord/discord-api-spec/blob/507909d1ea5a921064d599e1f3b57163af2037d6/specs/openapi.json#L23049-L23052

This pull request puts sensible defaults into place.

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

Copy link

vercel bot commented May 7, 2025

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 May 7, 2025 4:43pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview May 7, 2025 4:43pm

Copy link
Member

@almeidx almeidx left a comment

Choose a reason for hiding this comment

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

Looking at the specification, only id and type are definitely sent

Perhaps we should also add ?? null to the name prop then

@github-project-automation github-project-automation bot moved this from Todo to Review Approved in discord.js May 7, 2025
@kodiakhq kodiakhq bot merged commit 320e3a6 into main May 7, 2025
8 checks passed
@kodiakhq kodiakhq bot deleted the fix/channel-from-invite branch May 7, 2025 16:45
@github-project-automation github-project-automation bot moved this from Review Approved to Done in discord.js May 7, 2025
Jiralite added a commit that referenced this pull request May 7, 2025
fix(PartialGroupDMChannel): prevent `undefined` values

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

Successfully merging this pull request may close these issues.

4 participants