+ CorpAsyncSendMarkdown

This commit is contained in:
gazebo
2019-07-17 09:20:48 +08:00
parent cc450b7138
commit 05668962da
2 changed files with 92 additions and 6 deletions

View File

@@ -7,6 +7,17 @@ const (
MaxWorkContentLen = MaxWorkMsgLen - 96
)
const (
MsgTyeText = "txt"
MsgTypeImage = "image"
MsgTypeVoice = "voice"
MsgTypeFile = "file"
MsgTypeLink = "link"
MsgTypeOA = "oa"
MsgTypeMarkdown = "markdown"
MsgTypeActionCard = "action_card"
)
func (a *API) CorpAsyncSend(userIDList, deptIDList []string, isToAllUser bool, msg map[string]interface{}) (err error) {
params := map[string]interface{}{
"agent_id": a.agentID,
@@ -33,3 +44,13 @@ func (a *API) CorpAsyncSendSimple(userID, content string) (err error) {
},
})
}
func (a *API) CorpAsyncSendMarkdown(userIDList, deptIDList []string, isToAllUser bool, title, content string) (err error) {
return a.CorpAsyncSend(userIDList, deptIDList, isToAllUser, map[string]interface{}{
"msgtype": "markdown",
"markdown": map[string]interface{}{
"title": title,
"text": content,
},
})
}