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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Write([]byte("accepted"))
|
|
||||||
|
|
||||||
response, err := cps.Handle(context.Background(), message.Body)
|
response, err := cps.Handle(context.Background(), message.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("twilio receive hook: %s", err)
|
log.Printf("twilio receive hook: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = Send(message.Source, response.String())
|
w.Write([]byte(response.String()))
|
||||||
if err != nil {
|
|
||||||
log.Printf("twilio receive hook: %s", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue