mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 23:11:25 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user