oapi-sdk-java icon indicating copy to clipboard operation
oapi-sdk-java copied to clipboard

飞书接口在飞书卡片中@用户的方法有个坑

Open kennywgx opened this issue 1 year ago • 1 comments

官方文档给出的示例有错误: image card字段应该改为content

另外,飞书消息和飞书卡片中@用户的方式是有区别的:

飞书消息:

<at user_id="xxxx"/>

飞书卡片:

<at id="xxxx"/>

飞书富文本(我没试过):

{
      "tag": "at",
      "user_id": "xxxx"
}

而在sdk中只找到1中方式:

        // com.lark.oapi.service.im.v1.model.ext.MessageText.java
        public Builder atUser(String userId, String name) {
            sb.append("<at user_id=\\\"")
                    .append(userId)
                    .append("\\\">")
                    .append(name)
                    .append("</at>");
            return this;
        }

希望可以增加对其他方式的支持,或者能说明清楚~ 我尝试了好久一直在使用错误的字段=。=

kennywgx avatar Sep 19 '24 10:09 kennywgx

这个请求体折磨了我三天的时间才试出来,全靠猜

Alexro0t avatar Oct 29 '24 00:10 Alexro0t