-
Notifications
You must be signed in to change notification settings - Fork 1
Fix chatops-lark bot to handle rich text messages #347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Added structures for parsing rich text (post) messages - Implemented extractTextFromMessage function to handle both text and post message types - Updated parseGroupCommand and parsePrivateCommand to use the new extraction function - Added debug logging for message types - Added comprehensive test coverage for text and post message parsing Co-authored-by: wuhuizuo <2574558+wuhuizuo@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Co-authored-by: wuhuizuo <2574558+wuhuizuo@users.noreply.github.com>
- Use counter for @mentions to handle multiple mentions properly - Replace custom contains function with strings.Contains from stdlib - Add fmt import for sprintf Co-authored-by: wuhuizuo <2574558+wuhuizuo@users.noreply.github.com>
- Process lines properly to avoid trailing spaces - More efficient string joining logic - Better code structure Co-authored-by: wuhuizuo <2574558+wuhuizuo@users.noreply.github.com>
The bot only parsed plain text messages (
message_type: "text"), silently ignoring rich text messages (message_type: "post") sent with code blocks or formatting.Changes
postmessage format, which contains language-specific content arrays with tagged elementsextractTextFromMessage()that handles both message types, preserving @mentions as@_user_Nplaceholders for regex matchingparseGroupCommand()andparsePrivateCommand()now use the new extraction functionExample
Rich text messages now parse correctly:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.