Skip to content

Commit fbbab0d

Browse files
committed
fix(discord): preserve 204 no-body webhook success path
1 parent 6cee355 commit fbbab0d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

extensions/discord/src/send.webhook.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,13 @@ export async function sendWebhookMessageDiscord(
124124
await throwWebhookResponseError(response);
125125
}
126126

127-
const payload = await readProviderJsonResponse<{
128-
id?: string;
129-
channel_id?: string;
130-
}>(response, "Discord webhook send");
127+
const payload =
128+
response.status === 204
129+
? ({} as { id?: string; channel_id?: string })
130+
: await readProviderJsonResponse<{
131+
id?: string;
132+
channel_id?: string;
133+
}>(response, "Discord webhook send");
131134
try {
132135
recordChannelActivity({
133136
channel: "discord",

0 commit comments

Comments
 (0)