feat(feishu): add ACK reaction (已读标记) feature#290
Merged
everettjf merged 1 commit intomicroclaw:mainfrom Apr 1, 2026
Merged
Conversation
- Add locale-aware ACK reactions (Chinese Simplified/Traditional, English, Japanese) - Detect text locale and select appropriate emoji - Send reaction automatically when receiving messages - Ported from ZeroClaw's lark.rs implementation Closes: microclaw#198
Contributor
|
👍 Thanks |
Contributor
|
按现在这版代码,它会对每条收到的 Feishu 消息自动加一个 reaction,不是文本回复,是“表情标记”。 关键路径在 src/channels/feishu.rs:2578。消息只要满足这些前置条件,就会异步发 ACK reaction:
然后它立刻:
它不是“只有被 @ 才点表情”。因为 ACK 发生在 mention 判断之前,而真正的回复门槛在后面 src/channels/feishu.rs:2856:
所以当前行为可以概括成: 表情不是随机数真随机,而是“用消息文本做 hash 后稳定选一个”,所以同样的文本通常会得到同一个 reaction。 |
Contributor
@lch541 Hi,这样感觉行为不是很符合预期。你的预期是每个消息都发一个表情表示已经收到吗? |
Contributor
Author
|
正是如此,本次修改只是让机器收到消息后立刻发一个已收的回执,在原来的飞书通道中,用户给机器人发个消息没有任何反应,不知道它是否已收到。
在 2026年3月23日,12:14,Everett ***@***.***> 写道:
[https://avatars.githubusercontent.com/u/1665109?s=20&v=4]everettjf left a comment (microclaw/microclaw#290)<#290 (comment)>
按现在这版代码,它会对每条收到的 Feishu 消息自动加一个 reaction,不是文本回复,是“表情标记”。
关键路径在 src/channels/feishu.rs:2578。消息只要满足这些前置条件,就会异步发 ACK reaction:
* 事件类型是 im.message.receive_v1
* 不是机器人自己发的
* chat_id 和消息内容不为空
* 文本解析后不是空
* 如果配了 allowed_chats,消息必须在允许名单里
然后它立刻:
* 根据消息文本做一个很简单的语言判断,分成 ZhCn / ZhTw / En / Ja
* 从对应表情池里挑一个 reaction
* 调 Feishu API 给这条消息点 reaction
它不是“只有被 @ 才点表情”。因为 ACK 发生在 mention 判断之前,而真正的回复门槛在后面 src/channels/feishu.rs:2856:
* should_respond = is_dm || is_mentioned || is_at_all
所以当前行为可以概括成:
* DM:会自动点表情,也会继续正常回复
* 群聊里 @bot<https://github.com/bot> / @ALL<https://github.com/ALL>:会自动点表情,也会继续正常回复
* 群聊里没 @bot<https://github.com/bot>:也会自动点表情,但不会发文本回复
表情不是随机数真随机,而是“用消息文本做 hash 后稳定选一个”,所以同样的文本通常会得到同一个 reaction。
@lch541<https://github.com/lch541> Hi,这样感觉行为不是很符合预期。你的预期是每个消息都发一个表情表示已经收到吗?
—
Reply to this email directly, view it on GitHub<#290?email_source=notifications&email_token=B57RVPKO5SC5DMJ7NOGO5ML4SC2Z3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJQG44DMMBVGUYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4107860550>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B57RVPMGMYIDR2IHIA6IJOD4SC2Z3AVCNFSM6AAAAACW3AYZ3WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMBXHA3DANJVGA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Contributor
|
@lch541 好的,我再看看这块。之前为了加飞书表情把文件发送改坏了。这个 pr 先放着哈,我这几天统一再看看。
|
Contributor
Author
|
加油
在 2026年3月24日,13:56,Everett ***@***.***> 写道:
[https://avatars.githubusercontent.com/u/1665109?s=20&v=4]everettjf left a comment (microclaw/microclaw#290)<#290 (comment)>
@lch541<https://github.com/lch541> 好的,我再看看这块。之前为了加飞书表情把文件发送改坏了。这个 pr 先放着哈,我这几天统一再看看。
今天刚支持了 weixin,马上发个版哈哈
—
Reply to this email directly, view it on GitHub<#290?email_source=notifications&email_token=B57RVPN7LWFZHKHPVDLHRTT4SIPQHA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJRGU3DAMZZGI22M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4115603925>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B57RVPL3ZJ72ZGPQZW4STBL4SIPQHAVCNFSM6AAAAACW3AYZ3WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMJVGYYDGOJSGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
3 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add automatic ACK reaction (已读标记) feature to Feishu channel.
Changes
This feature is ported from ZeroClaw's lark.rs implementation.
Closes #198