Skip to content

Commit

Permalink
customer_bot send message, content -> card
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaomingqiang committed May 9, 2022
1 parent d9adb9f commit 96f23e6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion v2/customer_bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ type customerBotSendMessageReq struct {
Timestamp string `json:"timestamp,omitempty"`
Sign string `json:"sign,omitempty"`
MsgType string `json:"msg_type,omitempty"`
Content interface{} `json:"content"`
Content interface{} `json:"content,omitempty"`
Card interface{} `json:"card,omitempty"`
}

func (c *CustomerBot) sign(timestamp string) (string, error) {
Expand All @@ -89,6 +90,14 @@ func (c *CustomerBot) newSendMessageReq(msgType string, content interface{}) (*c
return nil, err
}
}
if msgType == "interactive" {
return &customerBotSendMessageReq{
Timestamp: timestamp,
Sign: sign,
MsgType: msgType,
Card: content,
}, nil
}
return &customerBotSendMessageReq{
Timestamp: timestamp,
Sign: sign,
Expand Down

0 comments on commit 96f23e6

Please sign in to comment.