diff --git a/apps/server/src/webhook.ts b/apps/server/src/webhook.ts index a5aebc6..6ae5cfe 100644 --- a/apps/server/src/webhook.ts +++ b/apps/server/src/webhook.ts @@ -108,7 +108,9 @@ const getRequestBody = async (c: Context): Promise => { delete body.file; } - const image = Array.isArray(body.image) ? (body.image[0] as unknown) : body.image; + const image = Array.isArray(body.image) + ? (body.image[0] as unknown) + : body.image; if (image instanceof File) { const buffer = Buffer.from(await image.arrayBuffer()); const imageKey = await feishuClient.uploadImage(buffer); @@ -217,8 +219,9 @@ const dispatchAlert = async ( typeof content === "object" && "text" in content ) { - (content as Record).text = `[Direct Message]\n${(content as Record).text - }`; + (content as Record).text = `[Direct Message]\n${ + (content as Record).text + }`; } // Add prefix for interactive if ( @@ -227,10 +230,14 @@ const dispatchAlert = async ( typeof content === "object" && "header" in content ) { - const c = content as Record>>; + const c = content as Record< + string, + Record> + >; if (c.header?.title?.content) { - c.header.title.content = `[${topic.slug || topic.name}] ${c.header.title.content - }`; + c.header.title.content = `[${topic.slug || topic.name}] ${ + c.header.title.content + }`; } } messagesToSend.push({ @@ -289,8 +296,9 @@ const dispatchAlert = async ( typeof content === "object" && "text" in content ) { - (content as Record).text = `[${topic.name}]\n${(content as Record).text - }`; + (content as Record).text = `[${topic.name}]\n${ + (content as Record).text + }`; } messagesToSend.push({ type: msgType,