File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,26 +216,28 @@ export default new Hono<{ Bindings: Env }>()
216216 } )
217217 . post ( "/feishu" , async ( c ) => {
218218 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+ }
227229 }
228- }
229- }
230230 console . log ( JSON . stringify ( body , null , 2 ) )
231231 const challenge = body . challenge
232232 if ( challenge ) return c . json ( { challenge } )
233233
234234 const content = body . event ?. message ?. content
235235 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
239241 const text = typeof parsed ?. text === "string" ? parsed . text : typeof content === "string" ? content : ""
240242
241243 let message = text . trim ( ) . replace ( / ^ @ _ u s e r _ \d + \s * / , "" )
You can’t perform that action at this time.
0 commit comments