-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(structure): add Webhook structure #11401
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
base: main
Are you sure you want to change the base?
feat(structure): add Webhook structure #11401
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
📝 WalkthroughWalkthroughIntroduces a new Webhook class within a dedicated webhooks module, extending the Structure base class with properties and computed accessors for Discord webhook objects. The class is propagated through barrel exports at both module and package levels. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/structures/src/webhooks/Webhook.ts`:
- Around line 8-13: Update the class doc remark in Webhook.ts (the Webhook JSDoc
above the Webhook class/DataTemplate usage) to reference the actual API field
names—use "user", "source_guild", and "source_channel" instead of `User`,
`Guild`, `Channel`—and note that source_guild and source_channel are partial
objects specific to Channel Follower webhooks (not full Guild/Channel
structures) so users understand their limited shape.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
packages/structures/src/index.tspackages/structures/src/webhooks/Webhook.tspackages/structures/src/webhooks/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Tests
🔇 Additional comments (3)
packages/structures/src/webhooks/index.ts (1)
1-1: LGTM!Standard barrel export pattern consistent with other module directories in the project.
packages/structures/src/index.ts (1)
15-15: LGTM!The new webhooks export follows the established barrel export pattern and is appropriately placed before the type-only exports.
packages/structures/src/webhooks/Webhook.ts (1)
14-107: Implementation looks solid.The class correctly:
- Extends
Structure<APIWebhook, Omitted>with appropriate generic handling- Exposes all primary webhook properties via getters
- Uses
isIdSetguard before computingcreatedTimestampfrom the snowflake- Properly handles nullable timestamp conversion in
createdAtThe design decision to delegate substructure instantiation (
user,source_guild,source_channel) to extending classes is reasonable and documented in the remarks.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11401 +/- ##
==========================================
- Coverage 31.62% 31.56% -0.06%
==========================================
Files 385 386 +1
Lines 13918 13944 +26
Branches 1096 1098 +2
==========================================
Hits 4401 4401
- Misses 9383 9409 +26
Partials 134 134
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR will add the
Webhookstructure.Mentioning #10981 for visibility.