Better reply method.
This commit is contained in:
parent
5cb1acb279
commit
f9a19b2f80
|
@ -36,15 +36,10 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
w.Write([]byte("accepted"))
|
||||
|
||||
response, err := cps.Handle(context.Background(), message.Body)
|
||||
if err != nil {
|
||||
log.Printf("twilio receive hook: %s", err)
|
||||
}
|
||||
|
||||
err = Send(message.Source, response.String())
|
||||
if err != nil {
|
||||
log.Printf("twilio receive hook: %s", err)
|
||||
}
|
||||
w.Write([]byte(response.String()))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue