- dingdingapi.NewWithAgentID

- CorpAsyncSend and CorpAsyncSendSimple remove agentID param
This commit is contained in:
gazebo
2019-03-22 14:17:29 +08:00
parent 09caec9124
commit e7cfef0960
4 changed files with 25 additions and 19 deletions

View File

@@ -2,9 +2,9 @@ package dingdingapi
import "strings"
func (a *API) CorpAsyncSend(agentID int, userIDList, deptIDList []string, isToAllUser bool, msg map[string]interface{}) (err error) {
func (a *API) CorpAsyncSend(userIDList, deptIDList []string, isToAllUser bool, msg map[string]interface{}) (err error) {
params := map[string]interface{}{
"agent_id": agentID,
"agent_id": a.agentID,
"msg": msg,
}
if len(userIDList) > 0 {
@@ -20,8 +20,8 @@ func (a *API) CorpAsyncSend(agentID int, userIDList, deptIDList []string, isToAl
return err
}
func (a *API) CorpAsyncSendSimple(agentID int, userID, content string) (err error) {
return a.CorpAsyncSend(agentID, []string{userID}, nil, false, map[string]interface{}{
func (a *API) CorpAsyncSendSimple(userID, content string) (err error) {
return a.CorpAsyncSend([]string{userID}, nil, false, map[string]interface{}{
"msgtype": "text",
"text": map[string]interface{}{
"content": content,