Remove debugging code
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user