Skip to content

Conversation

@Amgelo563
Copy link
Contributor

@Amgelo563 Amgelo563 commented May 26, 2025

Please describe the changes this PR makes and why it should be merged:

ApplicationEmoji and BaseGuildEmoji inherit some incorrect nullables from Emoji (since they are never null for their case). Also BaseGuildEmoji#url wasn't marked as deprecated in the index.d.ts and ApplicationEmoji#available was missing (though always true, added for consistency with the rest). Internal discussion at https://discord.com/channels/222078108977594368/1366526457064591440/1366526457064591440

Supersedes #10905
Supersedes #10912

Fixes #10858

Specific (attempted) changes

Typings

  • Remove | null from ApplicationEmoji#author, managed, and requiresColons
  • Change ApplicationEmoji#managed's type to false and requiresColons to true
  • Add ApplicationEmoji#available: true
  • Type override ApplicationEmoji#name, animated, imageURL, createdAt and createdTimestamp to make them non nullable
  • Type override BaseGuildEmoji#name, animated, and managed to make them non nullable (the other properties were already non nullable)
  • Remove BaseGuildEmoji#url and Emoji#url since those aren't present in runtime anymore

JS

  • Add jsdoc comments overriding ApplicationEmoji#name, animated, imageURL, createdAt and createdTimestamp's to remove the "or null if unicode" mentions
  • Add jsdoc comments overriding BaseGuildEmoji#name, animated, createdAt and createdTimestamp's to remove the "or null if unicode" mentions (imageURL already has them)
  • Add available on ApplicationEmoji:
    • Set to null in constructor
    • Set in _patch()
    • Add check to equals()

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 May 26, 2025 18:38
@Amgelo563 Amgelo563 requested a review from SpaceEEC May 26, 2025 18:38
@vercel
Copy link

vercel bot commented May 26, 2025

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 30, 2025 7:03pm
discord-js-guide ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2025 7:03pm

@almeidx almeidx changed the title fix(Emoji): remove incorrect nullables from ApplicationEmoji and GuildEmoji, add ApplicationEmoji#managed fix(Emoji): remove incorrect nullables, add ApplicationEmoji#available May 26, 2025
@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js May 26, 2025
@Amgelo563 Amgelo563 requested a review from Jiralite May 27, 2025 15:03
@Jiralite
Copy link
Member

Please resolve conflicts!

@github-project-automation github-project-automation bot moved this from Review in Progress to Review Approved in discord.js May 30, 2025
@kodiakhq kodiakhq bot merged commit ef2c1bf into discordjs:main May 30, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Review Approved to Done in discord.js May 30, 2025
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.

Incorrect typing for ApplicationEmoji

4 participants