@@ -450,24 +450,15 @@ function formatSubMessageContent(content: string, contentType: string): string {
450450 }
451451}
452452
453- function checkBotMentioned (
454- event : FeishuMessageEvent ,
455- botOpenId ?: string ,
456- botName ?: string ,
457- ) : boolean {
453+ function checkBotMentioned ( event : FeishuMessageEvent , botOpenId ?: string ) : boolean {
458454 if ( ! botOpenId ) return false ;
459455 // Check for @all (@_all in Feishu) — treat as mentioning every bot
460456 const rawContent = event . message . content ?? "" ;
461457 if ( rawContent . includes ( "@_all" ) ) return true ;
462458 const mentions = event . message . mentions ?? [ ] ;
463459 if ( mentions . length > 0 ) {
464- return mentions . some ( ( m ) => {
465- if ( m . id . open_id !== botOpenId ) return false ;
466- // Guard against Feishu WS open_id remapping in multi-app groups:
467- // if botName is known and mention name differs, this is a false positive.
468- if ( botName && m . name && m . name !== botName ) return false ;
469- return true ;
470- } ) ;
460+ // Rely on Feishu mention IDs; display names can vary by alias/context.
461+ return mentions . some ( ( m ) => m . id . open_id === botOpenId ) ;
471462 }
472463 // Post (rich text) messages may have empty message.mentions when they contain docs/paste
473464 if ( event . message . message_type === "post" ) {
@@ -768,10 +759,10 @@ export function buildBroadcastSessionKey(
768759export function parseFeishuMessageEvent (
769760 event : FeishuMessageEvent ,
770761 botOpenId ?: string ,
771- botName ?: string ,
762+ _botName ?: string ,
772763) : FeishuMessageContext {
773764 const rawContent = parseMessageContent ( event . message . content , event . message . message_type ) ;
774- const mentionedBot = checkBotMentioned ( event , botOpenId , botName ) ;
765+ const mentionedBot = checkBotMentioned ( event , botOpenId ) ;
775766 const hasAnyMention = ( event . message . mentions ?. length ?? 0 ) > 0 ;
776767 // In p2p, the bot mention is a pure addressing prefix with no semantic value;
777768 // strip it so slash commands like @Bot /help still have a leading /.
0 commit comments