summaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/handler.go b/handler.go
index f9d4a1e..ce9f2a7 100644
--- a/handler.go
+++ b/handler.go
@@ -28,10 +28,9 @@ func WebhookHandler(w http.ResponseWriter, r *http.Request) {
err := decoder.Decode(&hook)
if err != nil {
-
- content, err := ioutil.ReadAll(r.Body)
+ content, cError := ioutil.ReadAll(r.Body)
if err != nil {
- log.Println("Can't read r.Body.", err)
+ log.Println("Can't read r.Body.", cError)
}
body := string(content)
@@ -41,6 +40,7 @@ func WebhookHandler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Wrong JSON. " + err.Error() + " Original message: " + body))
return
}
+
if hook.Join != "" {
log.Println("Joining #" + hook.Join)
con.Join("#" + hook.Join)