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