diff --git a/frontend/telegram_bot.go b/frontend/telegram_bot.go index 809350b..a6bc32e 100644 --- a/frontend/telegram_bot.go +++ b/frontend/telegram_bot.go @@ -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