Skip to content

fix(Emoji): remove incorrect nullables, add ApplicationEmoji#available #10913

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

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

Supercedes #10905
Supercedes #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
Copy link

vercel bot commented May 26, 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 28, 2025 7:56pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview May 28, 2025 7:56pm

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

Incorrect typing for ApplicationEmoji
3 participants