mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-27 12:47:13 +00:00
855ae2bdba
The LINE adapter passed text through as a single Plain component, ignoring the mention payload (mentions[].index/length/isSelf) that the Line Messaging API includes in the webhook. As a result: - At(target=bot_account_id) never appeared in the message chain, so the 'at-bot' group respond rule silently dropped every @bot mention. - The bot only replied when the message happened to match the prefix rule (e.g. starting with 'ai'). Now LINEMessageConverter reads message.message.mention and builds the chain per mention position: - Bot mention (isSelf) -> At(target=bot_account_id) so AtBotRule matches the same way as other adapters (dingtalk/lark etc.). - Other mentions -> At(target=<line user id>, display=<mention text>). At.__str__ already prepends '@', so the display text carries no double '@' and the rendered text (prefix/regexp rules, quotes, session context) is byte-identical to before. - Missing/out-of-bounds mentions are skipped defensively. target2yiri becomes an instance method (like wechatpad/aiocqhttp) so the converters can hold bot_account_id; LINEAdapter passes it in from its own config.