forked from an/flokati
		
	testing webhooks
This commit is contained in:
		
							parent
							
								
									f603c503f6
								
							
						
					
					
						commit
						8e9e8e162c
					
				
					 1 changed files with 13 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -27,19 +27,19 @@ func webhookRun() {
 | 
			
		|||
	xlog.Fatal("%v", http.ListenAndServe(":"+*webhookPort, nil))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//func webhookHandleMessage(m *Message) {
 | 
			
		||||
//	tok := strings.Split(m.Text, " ")
 | 
			
		||||
//	if len(tok) < 1 {
 | 
			
		||||
//		return
 | 
			
		||||
//	}
 | 
			
		||||
//	switch tok[0] {
 | 
			
		||||
//	case "!webhook-add":
 | 
			
		||||
//		if len(tok) > 1 {
 | 
			
		||||
//			http.HandleFunc("/webhook/"+tok[1], webhookHandleHTTP)
 | 
			
		||||
//		}
 | 
			
		||||
//	default:
 | 
			
		||||
//	}
 | 
			
		||||
//}
 | 
			
		||||
func webhookHandleMessage(m *Message) {
 | 
			
		||||
	//	tok := strings.Split(m.Text, " ")
 | 
			
		||||
	//	if len(tok) < 1 {
 | 
			
		||||
	//		return
 | 
			
		||||
	//	}
 | 
			
		||||
	//	switch tok[0] {
 | 
			
		||||
	//	case "!webhook-add":
 | 
			
		||||
	//		if len(tok) > 1 {
 | 
			
		||||
	//			http.HandleFunc("/webhook/"+tok[1], webhookHandleHTTP)
 | 
			
		||||
	//		}
 | 
			
		||||
	//	default:
 | 
			
		||||
	//	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func webhookHandleHTTP(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
	data := make(map[string]interface{})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue