- dingdingapi.NewWithAgentID
- CorpAsyncSend and CorpAsyncSendSimple remove agentID param
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user