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

feat: export BaseCommandInteraction #6478

Merged
merged 1 commit into from Aug 23, 2021
Merged

feat: export BaseCommandInteraction #6478

merged 1 commit into from Aug 23, 2021

Conversation

wakfi
Copy link
Contributor

@wakfi wakfi commented Aug 20, 2021

Please describe the changes this PR makes and why it should be merged:
This PR adds BaseCommandInteraction to the index.js file.

This PR changes the library's interface (methods or parameters added)

@monbrey
Copy link
Member

monbrey commented Aug 20, 2021

What's the reason for exporting this one? It shouldn't ever be constructed, everything should be a subclass of it.

@wakfi
Copy link
Contributor Author

wakfi commented Aug 20, 2021

I'm wanting to use it for polymorphic behavior. I have an Interaction, which could be any of the subclasses, but I'm only interested in accessing the properties defined in the abstract BaseCommandInteraction. I'd like to be able to run instanceof checks with BaseCommandInteraction to accomplish this, rather than needing to check each subclass separately.

I'm working in TypeScript, and this class is exported in the type definitions which makes it appear to be usable in this way, but since it isn't exported in index.js the import is always undefined.

@iCrawl iCrawl added this to the Version 13.2 milestone Aug 21, 2021
@iCrawl iCrawl merged commit c14e594 into discordjs:main Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants