Skip to content
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

refactor: remove discord.js enums and use discord-api-types enums instead #7077

Merged
merged 15 commits into from
Jan 12, 2022

Conversation

suneettipirneni
Copy link
Member

@suneettipirneni suneettipirneni commented Dec 8, 2021

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

TODO:

  • Make sure spots weren't missed
  • Test for any regressions

Note: I won't be updating the enums for any components. I'll wait for #7040 to be merged before I modify anything with components.

Status and versioning classification:
Please move lines that apply to you out of the comment:

  • 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
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

@suneettipirneni suneettipirneni changed the title refactor: remove discord.js enums and use discord-api-types for enums instead refactor: remove discord.js enums and use discord-api-types enums instead Dec 8, 2021
@kyranet kyranet added this to the Version 14 milestone Dec 8, 2021
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/managers/ApplicationCommandPermissionsManager.js Outdated Show resolved Hide resolved
@suneettipirneni suneettipirneni marked this pull request as ready for review January 9, 2022 03:53
kyranet
kyranet previously requested changes Jan 9, 2022
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

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

This PR makes me very happy, we're finally getting PascalCased enums!

Just a couple of things :P

packages/discord.js/src/structures/GuildAuditLogs.js Outdated Show resolved Hide resolved
@ImRodry
Copy link
Contributor

ImRodry commented Jan 9, 2022

The API documents pretty much every type as UPPER_CASE (example), why are we switching to PascalCase?

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.

These were not updated:

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/MessageMentions.js#L4

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/ContextMenuCommandInteraction.js#L5

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/CommandInteraction.js#L7

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/BaseMessageComponent.js#L4

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/MessageActionRow.js#L4

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/MessageButton.js#L5

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/MessageComponentInteraction.js#L6

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/MessageSelectMenu.js#L4

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/managers/GuildScheduledEventManager.js#L7

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/structures/GuildScheduledEvent.js#L9

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/managers/GuildScheduledEventManager.js#L7


This was removed from the constants. So it should be removed from here too. However, it's being used in other files (the doc type) and it doesn't exist anymore

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/src/util/Constants.js#L585


This type should be removed:

https://github.com/suneettipirneni/discord.js/blob/84f0da43041887c13897ba40f70f9b2e2179f277/packages/discord.js/typings/index.d.ts#L2766

@suneettipirneni
Copy link
Member Author

These were not updated:

I fixed all of these except for the components, as stated in the PR description those will updated in another PR.

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.

9 participants