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: add typeguards to webhooks #6850

Merged
merged 5 commits into from Oct 19, 2021

Conversation

suneettipirneni
Copy link
Member

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

The docs for the webhook object state that some properties aren't available on certain types of webhooks. This PR enforces this, and allows for type guarding of different webhook variants.

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
  • This PR changes the library's interface (methods or parameters added)

typings/index.d.ts Outdated Show resolved Hide resolved
src/structures/Webhook.js Outdated Show resolved Hide resolved
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.

What @ImRodry mentioned, and this should also add type tests.

@iCrawl iCrawl merged commit e0afcad into discordjs:main Oct 19, 2021
@suneettipirneni suneettipirneni deleted the feat/webhook-typeguards branch July 6, 2022 15:21
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

6 participants