Remove debugging code

This commit is contained in:
Lan Tian
2020-04-08 00:16:52 +08:00
parent 4b3e3a8109
commit 57e13faed9

View File

@@ -1,9 +1,7 @@
package main
import (
"bytes"
"encoding/json"
"io/ioutil"
"net/http"
"strings"
)
@@ -39,13 +37,10 @@ func telegramIsCommand(message string, command string) bool {
}
func webHandlerTelegramBot(w http.ResponseWriter, r *http.Request) {
bodyBuffer, _ := ioutil.ReadAll(r.Body)
println(string(bodyBuffer))
// Parse only needed fields of incoming JSON body
var err error
var request tgWebhookRequest
err = json.NewDecoder(bytes.NewReader(bodyBuffer)).Decode(&request)
err = json.NewDecoder(r.Body).Decode(&request)
if err != nil {
println(err.Error())
return