Skip to content

Conversation

@AsadHumayun
Copy link
Contributor

This PR will add the Webhook structure.

Mentioning #10981 for visibility.

@AsadHumayun AsadHumayun requested a review from a team as a code owner January 25, 2026 02:07
@vercel vercel bot temporarily deployed to Preview – discord-js January 25, 2026 02:07 Inactive
@vercel
Copy link

vercel bot commented Jan 25, 2026

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

2 Skipped Deployments
Project Deployment Review Updated (UTC)
discord-js Skipped Skipped Jan 29, 2026 1:40pm
discord-js-guide Skipped Skipped Jan 29, 2026 1:40pm

Request Review

@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 25, 2026 02:07 Inactive
@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

Introduces 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

Cohort / File(s) Summary
Webhooks module
packages/structures/src/webhooks/Webhook.ts, packages/structures/src/webhooks/index.ts
New Webhook class extending Structure<APIWebhook, Omitted> with public getters for webhook properties (id, type, guildId, channelId, name, avatar, token, applicationId, url). Includes computed properties createdTimestamp and createdAt derived from DiscordSnowflake. Re-exported via index barrel.
Root structures export
packages/structures/src/index.ts
Added re-export of webhooks module to propagate Webhook class through package public API.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: introducing a new Webhook structure to the codebase.
Description check ✅ Passed The description is directly related to the changeset, stating the PR adds the Webhook structure and references a related issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3550b49 and 5c741bd.

📒 Files selected for processing (3)
  • packages/structures/src/index.ts
  • packages/structures/src/webhooks/Webhook.ts
  • packages/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 isIdSet guard before computing createdTimestamp from the snowflake
  • Properly handles nullable timestamp conversion in createdAt

The 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
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.56%. Comparing base (c71228a) to head (9258091).

Files with missing lines Patch % Lines
packages/structures/src/webhooks/Webhook.ts 0.00% 26 Missing ⚠️
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              
Flag Coverage Δ
structures 35.03% <0.00%> (-0.64%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Qjuh
Qjuh previously requested changes Jan 25, 2026
@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Jan 25, 2026
@vercel vercel bot temporarily deployed to Preview – discord-js January 25, 2026 11:57 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 25, 2026 11:57 Inactive
@AsadHumayun AsadHumayun requested a review from Qjuh January 25, 2026 11:58
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 27, 2026 23:29 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 27, 2026 23:29 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 29, 2026 13:40 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 29, 2026 13:40 Inactive
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.

3 participants