Skip to content

Conversation

@keston-dev
Copy link

@keston-dev keston-dev commented Jan 23, 2026

This PR will add the Application API structure, per Discord's API documentation, as well as the ApplicationFlagsBitField to /bitfields.

Mentioning #10981 for visibility.

@vercel
Copy link

vercel bot commented Jan 23, 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 6:42pm
discord-js-guide Skipped Skipped Jan 29, 2026 6:42pm

Request Review

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

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

New Application class added that models a Discord application with comprehensive read-only access to APIApplication data via public getters. Includes new ApplicationFlagsBitField utility class for handling application flags. Both classes are exported through their respective index modules.

Changes

Cohort / File(s) Summary
Application Structure
packages/structures/src/application/Application.ts
New Application class extending Structure<APIApplication, Omitted> with 30+ public getters mapping to APIApplication fields (id, name, icon, description, bot properties, URLs, flags, counts, etc.). Flags getter returns ApplicationFlagsBitField instance or null. Constructor accepts Partialize<APIApplication, Omitted>.
Application Module Exports
packages/structures/src/application/index.ts
Re-exports all exports from ./Application.js to make the Application class available through the module index.
Application Flags BitField
packages/structures/src/bitfields/ApplicationFlagsBitField.ts
New ApplicationFlagsBitField class extending BitField<keyof ApplicationFlags>. Exposes static Flags member set to ApplicationFlags enum. Overrides toJSON() to delegate to base implementation.
BitField Module Exports
packages/structures/src/bitfields/index.ts
Re-exports ApplicationFlagsBitField from the bitfields index module alongside existing bitfield exports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new Application structure class to the structures package.
Description check ✅ Passed The description is relevant and explains what is being added (Application API structure and ApplicationFlagsBitField) with a reference to Discord's API documentation.
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: 4

🤖 Fix all issues with AI agents
In `@packages/structures/src/application/Application.ts`:
- Around line 165-168: The getter Application.prototype.flags treats
this[kData].flags as missing when it's 0 due to a truthy check; change the check
in the get flags accessor to use a nullish check (e.g., compare against
null/undefined) so that zero is preserved and still returns new
ApplicationFlagsBitField(this[kData].flags as ApplicationFlags) instead of null;
update the logic in the get flags method that references this[kData].flags and
ApplicationFlagsBitField to perform the null/undefined check.
- Around line 220-224: The getter name eventsWebhookStatus is inconsistent with
eventWebhooksURL / eventWebhooksTypes and the API field event_webhooks_status;
rename the getter to eventWebhooksStatus (and update any references) so it
matches the camelCase convention, then update related typings, exports, and
documentation where eventsWebhookStatus is used to eventWebhooksStatus to keep
names consistent (search for eventsWebhookStatus, eventWebhooksURL,
eventWebhooksTypes and the kData access of event_webhooks_status to apply the
change).

In `@packages/structures/src/bitfields/ApplicationFlagsBitField.ts`:
- Around line 13-15: The toJSON override in ApplicationFlagsBitField is forcing
string serialization by calling super.toJSON(true); change it to use the base
numeric serialization (call super.toJSON() without the true flag) so numeric
bitflags are preserved, unless you intentionally want string output—in which
case update typings/docs to reflect string-returning toJSON; target the
ApplicationFlagsBitField class and its toJSON method and remove the true
argument from the super call.
- Around line 7-11: The implementation of ApplicationFlagsBitField uses the
wrong type parameter—change the extends clause from BitField<keyof
ApplicationFlags> to BitField<keyof typeof ApplicationFlags> to match the
exported ApplicationFlagsString typing; update the same pattern for
ChannelFlagsBitField, MessageFlagsBitField, and AttachmentFlagsBitField so all
use keyof typeof <FlagName> and ensure the static Flags = ApplicationFlags (and
respective Flags) remain unchanged.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 838cd2d and 122c5fb.

📒 Files selected for processing (4)
  • packages/structures/src/application/Application.ts
  • packages/structures/src/application/index.ts
  • packages/structures/src/bitfields/ApplicationFlagsBitField.ts
  • packages/structures/src/bitfields/index.ts
🧰 Additional context used
🧬 Code graph analysis (1)
packages/structures/src/bitfields/ApplicationFlagsBitField.ts (1)
packages/discord.js/typings/index.d.ts (2)
  • BitField (663-680)
  • ApplicationFlagsBitField (480-483)
🔇 Additional comments (2)
packages/structures/src/bitfields/index.ts (1)

3-3: LGTM: export added for ApplicationFlagsBitField

packages/structures/src/application/index.ts (1)

1-1: LGTM: Application export added

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 23, 2026 02:57 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 23, 2026 02:57 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 23, 2026 03:00 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 23, 2026 03:00 Inactive
Copy link
Contributor

@AsadHumayun AsadHumayun left a comment

Choose a reason for hiding this comment

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

Not a maintainer, just giving some suggestions based on the conventions I've seen so far in other structures and my own PRs.

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 0% with 70 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.46%. Comparing base (c71228a) to head (05f5d2b).

Files with missing lines Patch % Lines
packages/structures/src/application/Application.ts 0.00% 67 Missing ⚠️
...ructures/src/bitfields/ApplicationFlagsBitField.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11393      +/-   ##
==========================================
- Coverage   31.62%   31.46%   -0.16%     
==========================================
  Files         385      387       +2     
  Lines       13918    13988      +70     
  Branches     1096     1101       +5     
==========================================
  Hits         4401     4401              
- Misses       9383     9453      +70     
  Partials      134      134              
Flag Coverage Δ
structures 34.00% <0.00%> (-1.67%) ⬇️

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.

@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 23, 2026 15:37 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 23, 2026 15:37 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 23, 2026 15:39 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 24, 2026 21:46 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 24, 2026 21:46 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 24, 2026 21:47 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 24, 2026 21:47 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 25, 2026 14:55 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 25, 2026 14:55 Inactive
@keston-dev keston-dev requested a review from almeidx January 25, 2026 14:55
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 29, 2026 17:39 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 29, 2026 17:39 Inactive
Qjuh
Qjuh previously requested changes Jan 29, 2026
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 29, 2026 18:41 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 29, 2026 18:41 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 29, 2026 18:42 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 29, 2026 18:42 Inactive
@almeidx almeidx requested a review from Qjuh January 29, 2026 19:14
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.

4 participants