fix(discord): use fetch with proper headers for voice message upload

The @buape/carbon RequestClient wasn't setting Content-Type: application/json
for the attachments endpoint request. Use native fetch with explicit headers
for the upload URL request.

Also pass token through to sendDiscordVoiceMessage for authorization.
This commit is contained in:
nyanjou
2026-02-02 17:13:49 +01:00
committed by Shadow
parent a09e4fac3f
commit 36525a974e
2 changed files with 33 additions and 17 deletions

View File

@@ -38,7 +38,11 @@ export async function handleDiscordMessageAction(
required: true,
allowEmpty: true,
});
const mediaUrl = readStringParam(params, "media", { trim: false });
// Support media, path, and filePath for media URL
const mediaUrl =
readStringParam(params, "media", { trim: false }) ??
readStringParam(params, "path", { trim: false }) ??
readStringParam(params, "filePath", { trim: false });
const replyTo = readStringParam(params, "replyTo");
const embeds = Array.isArray(params.embeds) ? params.embeds : undefined;
const asVoice = params.asVoice === true;