testing webhooks

This commit is contained in:
an 2018-04-22 14:21:58 +02:00
parent caa291e0ea
commit 87857b4509
1 changed files with 12 additions and 11 deletions

View File

@ -7,6 +7,7 @@ import (
"flag" "flag"
"fmt" "fmt"
"net/http" "net/http"
"strings"
"git.dnix.de/an/xlog" "git.dnix.de/an/xlog"
) )
@ -28,17 +29,17 @@ func webhookRun() {
} }
func webhookHandleMessage(m *Message) { func webhookHandleMessage(m *Message) {
// tok := strings.Split(m.Text, " ") tok := strings.Split(m.Text, " ")
// if len(tok) < 1 { if len(tok) < 1 {
// return return
// } }
// switch tok[0] { switch tok[0] {
// case "!webhook-add": case "!webhook-add":
// if len(tok) > 1 { if len(tok) > 1 {
// http.HandleFunc("/webhook/"+tok[1], webhookHandleHTTP) http.HandleFunc("/webhook/"+tok[1], webhookHandleHTTP)
// } }
// default: default:
// } }
} }
func webhookHandleHTTP(w http.ResponseWriter, r *http.Request) { func webhookHandleHTTP(w http.ResponseWriter, r *http.Request) {