Skip to content

fix(core): webhook delete query type, removeMember await#11483

Merged
kodiakhq[bot] merged 4 commits into
mainfrom
fix/core-misc
Jul 20, 2026
Merged

fix(core): webhook delete query type, removeMember await#11483
kodiakhq[bot] merged 4 commits into
mainfrom
fix/core-misc

Conversation

@almeidx

@almeidx almeidx commented Apr 5, 2026

Copy link
Copy Markdown
Member

@almeidx
almeidx requested a review from a team as a code owner April 5, 2026 21:33
@vercel

vercel Bot commented Apr 5, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
discord-js Skipped Skipped Jul 20, 2026 11:26am
discord-js-guide Skipped Skipped Jul 20, 2026 11:26am

Request Review

@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cda15213-e3fe-4165-98a0-f50f0a731a54

📥 Commits

Reviewing files that changed from the base of the PR and between 1f9affd and 943dc19.

📒 Files selected for processing (2)
  • packages/core/src/api/guild.ts
  • packages/core/src/api/webhook.ts
📜 Recent review details
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: almeidx
Repo: discordjs/discord.js PR: 11471
File: packages/discord.js/src/util/Util.js:83-86
Timestamp: 2026-03-30T11:04:41.059Z
Learning: In discord.js (packages/discord.js and packages/rest), the `api` base URL and `version` string are used with raw interpolation (e.g. `${api}/v${version}${route}`) without normalization such as trailing slash trimming or stripping a leading "v". This is the established convention across the codebase (see REST.ts resolveRequest and fetchRecommendedShardCount in Util.js). Do not suggest normalizing these values.
🪛 GitHub Actions: Tests
packages/core/src/api/guild.ts

[error] Command failed: pnpm exec turbo run build --filter="...[origin/main]" --concurrency=4 (step @discordjs/core:build).

packages/core/src/api/webhook.ts

[error] 19-19: TypeScript build failed (TS2724): "discord-api-types/v10" has no exported member named 'RESTDeleteAPIWebhookWithTokenMessageQuery'. Did you mean 'RESTGetAPIWebhookWithTokenMessageQuery'?


[error] Command failed: pnpm exec turbo run build --filter="...[origin/main]" --concurrency=4 (step @discordjs/core:build).

🔇 Additional comments (2)
packages/core/src/api/guild.ts (1)

1240-1240: Good consistency update for removeMember.

Line 1240 now matches the existing 204-delete pattern used across this API wrapper and correctly resolves as Promise<void>.

packages/core/src/api/webhook.ts (1)

19-19: Build blocker: RESTDeleteAPIWebhookWithTokenMessageQuery is not exported by discord-api-types/v10.

Lines 19 and 263 import and use a type that CI reports as missing (TS2724). The type either does not yet exist in any published discord-api-types version, or the project needs to upgrade to a version where it is available. Until resolved, revert to the inline type or upgrade the dependency.

Temporary unblocking patch (fallback to inline type)
 	type RESTPostAPIWebhookWithTokenSlackQuery,
 	type RESTPostAPIWebhookWithTokenWaitResult,
-	type RESTDeleteAPIWebhookWithTokenMessageQuery,
 	type Snowflake,
 } from 'discord-api-types/v10';
@@
 	public async deleteMessage(
 		id: Snowflake,
 		token: string,
 		messageId: Snowflake,
-		query: RESTDeleteAPIWebhookWithTokenMessageQuery = {},
+		query: { thread_id?: Snowflake } = {},
 		{ signal }: Pick<RequestData, 'signal'> = {},
 	) {

📝 Walkthrough

Walkthrough

The changes refine two API methods in the core package. The GuildsAPI.removeMember method now explicitly awaits its REST deletion call instead of returning the promise directly. The WebhooksAPI.deleteMessage method's query parameter was updated to use a dedicated type from discord-api-types instead of an inline structural type. Both changes are type and control flow refinements with no runtime logic alterations.

Changes

Cohort / File(s) Summary
Guild API Update
packages/core/src/api/guild.ts
Modified removeMember to explicitly await the REST deletion call instead of returning the promise directly.
Webhook API Type Refinement
packages/core/src/api/webhook.ts
Updated deleteMessage query parameter from inline structural type to RESTDeleteAPIWebhookWithTokenMessageQuery imported from discord-api-types/v10.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes both main changes: webhook delete query type update and removeMember await fix.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for both modifications and noting an external dependency.
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
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/core-misc

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.

@almeidx
almeidx marked this pull request as draft April 5, 2026 21:53
@almeidx
almeidx marked this pull request as ready for review July 16, 2026 22:41
@vercel
vercel Bot temporarily deployed to Preview – discord-js July 16, 2026 23:48 Inactive
@vercel
vercel Bot temporarily deployed to Preview – discord-js-guide July 16, 2026 23:48 Inactive
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 32.07%. Comparing base (2037593) to head (6fad83c).

Files with missing lines Patch % Lines
packages/core/src/api/guild.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11483   +/-   ##
=======================================
  Coverage   32.06%   32.07%           
=======================================
  Files         390      390           
  Lines       14101    14100    -1     
  Branches     1113     1113           
=======================================
  Hits         4522     4522           
+ Misses       9441     9440    -1     
  Partials      138      138           
Flag Coverage Δ
brokers 11.56% <ø> (ø)
builders 69.08% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@github-project-automation github-project-automation Bot moved this from Todo to Review Approved in discord.js Jul 20, 2026
@vercel
vercel Bot temporarily deployed to Preview – discord-js July 20, 2026 11:26 Inactive
@vercel
vercel Bot temporarily deployed to Preview – discord-js-guide July 20, 2026 11:26 Inactive
@kodiakhq
kodiakhq Bot merged commit 2de90a7 into main Jul 20, 2026
28 checks passed
@github-project-automation github-project-automation Bot moved this from Review Approved to Done in discord.js Jul 20, 2026
@kodiakhq
kodiakhq Bot deleted the fix/core-misc branch July 20, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants