1
0
mirror of synced 2024-11-22 04:26:01 +03:00

update mg webhook response

This commit is contained in:
Alex Lushpai 2018-06-06 12:48:00 +03:00
parent dae3aac6e1
commit 194847c25b

View File

@ -203,8 +203,19 @@ func mgWebhookHandler(w http.ResponseWriter, r *http.Request) {
logger.Debugf("mgWebhookHandler sent %v", msg)
}
rsp, err := json.Marshal(map[string]string{"external_message_id": strconv.Itoa(msg.MessageID)})
if err != nil {
raven.CaptureErrorAndWait(err, nil)
logger.Error(err)
return
}
if config.Debug {
logger.Debugf("mgWebhookHandler update %v", rsp)
}
w.WriteHeader(http.StatusOK)
w.Write([]byte("Message sent"))
w.Write(rsp)
}
if msg.Type == "message_updated" {