GeezerVison is showing github.com — chore: generate · Verdagon/opencode@217e485
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/function/src/api.ts +15-13Lines changed: 15 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -216,26 +216,28 @@ export default new Hono<{ Bindings: Env }>() |
216 | 216 | }) |
217 | 217 | .post("/feishu", async (c) => { |
218 | 218 | const body = (await c.req.json()) as { |
219 | | - challenge?: string |
220 | | - event?: { |
221 | | - message?: { |
222 | | - message_id?: string |
223 | | - root_id?: string |
224 | | - parent_id?: string |
225 | | - chat_id?: string |
226 | | - content?: string |
| 219 | + challenge?: string |
| 220 | + event?: { |
| 221 | + message?: { |
| 222 | + message_id?: string |
| 223 | + root_id?: string |
| 224 | + parent_id?: string |
| 225 | + chat_id?: string |
| 226 | + content?: string |
| 227 | + } |
| 228 | + } |
227 | 229 | } |
228 | | - } |
229 | | -} |
230 | 230 | console.log(JSON.stringify(body, null, 2)) |
231 | 231 | const challenge = body.challenge |
232 | 232 | if (challenge) return c.json({ challenge }) |
233 | 233 |
|
234 | 234 | const content = body.event?.message?.content |
235 | 235 | const parsed = |
236 | | - typeof content === "string" && content.trim().startsWith("{") ? (JSON.parse(content) as { |
237 | | - text?: string |
238 | | -}) : undefined |
| 236 | + typeof content === "string" && content.trim().startsWith("{") |
| 237 | + ? (JSON.parse(content) as { |
| 238 | + text?: string |
| 239 | + }) |
| 240 | + : undefined |
239 | 241 | const text = typeof parsed?.text === "string" ? parsed.text : typeof content === "string" ? content : "" |
240 | 242 |
|
241 | 243 | let message = text.trim().replace(/^@_user_\d+\s*/, "") |
|