From d36182beedf004102550783db07f43ad4a2526d1 Mon Sep 17 00:00:00 2001 From: sliverp Date: Tue, 3 Feb 2026 14:52:53 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E4=BB=A5=E8=B0=83=E8=AF=95=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api.ts | 2 ++ src/gateway.ts | 1 + src/image-server.ts | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index 8951854..14fc8fb 100644 --- a/src/api.ts +++ b/src/api.ts @@ -390,7 +390,9 @@ export async function sendGroupImageMessage( content?: string ): Promise<{ id: string; timestamp: string }> { // 先上传图片获取 file_info + console.log(`[qqbot-api] sendGroupImageMessage: uploading image from URL: ${imageUrl}`); const uploadResult = await uploadGroupMedia(accessToken, groupOpenid, MediaFileType.IMAGE, imageUrl, false); + console.log(`[qqbot-api] sendGroupImageMessage: upload success, file_info: ${uploadResult.file_info?.slice(0, 50)}...`); // 再发送富媒体消息 return sendGroupMediaMessage(accessToken, groupOpenid, uploadResult.file_info, msgId, content); } diff --git a/src/gateway.ts b/src/gateway.ts index 98b84ac..2896cea 100644 --- a/src/gateway.ts +++ b/src/gateway.ts @@ -541,6 +541,7 @@ export async function startGateway(ctx: GatewayContext): Promise { try { // 先发送图片(如果有) + log?.info(`[qqbot:${account.accountId}] imageUrls to send: ${JSON.stringify(imageUrls)}, imageServerBaseUrl: ${imageServerBaseUrl}`); for (const imageUrl of imageUrls) { try { await sendWithTokenRetry(async (token) => { diff --git a/src/image-server.ts b/src/image-server.ts index 8bda378..6e4e565 100644 --- a/src/image-server.ts +++ b/src/image-server.ts @@ -335,7 +335,9 @@ export function saveImage( // 返回访问 URL const baseUrl = currentConfig.baseUrl || `http://localhost:${currentConfig.port}`; - return `${baseUrl}/images/${imageId}.${ext}`; + const resultUrl = `${baseUrl}/images/${imageId}.${ext}`; + console.log(`[image-server] saveImage: generated URL: ${resultUrl} (baseUrl: ${baseUrl})`); + return resultUrl; } /**