Skip to content

Conversation

Pavel-Boyazov
Copy link
Contributor

@Pavel-Boyazov Pavel-Boyazov commented Sep 29, 2025

Please describe the changes this PR makes and why it should be merged:
Allow to use native Events as key for ClientEventTypes (for examle ClientEventTypes[Events] instead of ClientEventTypes[keyof ClientEventTypes])

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

@vercel
Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
discord-js Ignored Ignored Preview Sep 29, 2025 10:07am
discord-js-guide Ignored Ignored Preview Sep 29, 2025 10:07am

Jiralite
Jiralite previously approved these changes Sep 29, 2025
@Jiralite Jiralite dismissed their stale review September 29, 2025 10:13

Awaiting tests.

Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

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

index.test-d.ts is full of errors due to this change.

It seems this stops strings from being used. Unsure if this is desired. @vladfrangu, any ideas?

@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Sep 29, 2025
@Jiralite Jiralite added this to the discord.js 15.0.0 milestone Sep 29, 2025
@Pavel-Boyazov
Copy link
Contributor Author

Pavel-Boyazov commented Sep 29, 2025

I agree that removing the ability to use strings directly is a bad idea. But I would also like to add compatibility of the type with the Events enum, since in fact they are completely identical.

@Pavel-Boyazov
Copy link
Contributor Author

As I see it, it comes down to the async_event_emitter's typing. I would like to understand more precisely what can and should be changed there in order to keep support for raw strings

@Pavel-Boyazov
Copy link
Contributor Author

Pavel-Boyazov commented Sep 29, 2025

Another problem. voiceServerUpdate event not exists in ClientEventTypes

@vladfrangu
Copy link
Member

Unsure if this is desired

I wouldn't want this to break normal strings, so if it does... I am -1 on this

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.

4 participants