func Askwit(textrequest string, res interface{}) error {
	//I prepare the request to send to wit.ai to interpret what is being said in Telegram
	req, err := http.NewRequest("GET", "https://api.wit.ai/message", nil)
	if err != nil {
		log.Print(err)
		os.Exit(1)
	}
	q := req.URL.Query()
	q.Add("q", textrequest)
	req.URL.RawQuery = q.Encode()
	fmt.Println(req.URL.String())
	req.Header.Add("Authorization", "Bearer ")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("X-Accept", "application/json")
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error when sending request to the server")
	}
	defer resp.Body.Close()

	return json.NewDecoder(resp.Body).Decode(res)
}
//Askwit is the function that sends the request to Wit.ai
Askwit is the function that sends the request to Wit.ai
// Askwit is the function that sends the request to Wit . ai
func Askwit(textrequest string, res interface{}) error {
	req, err := http.NewRequest("GET", "https://api.wit.ai/message", nil)
	if err != nil {
		log.Print(err)
		os.Exit(1)
	}
	q := req.URL.Query()
	q.Add("q", textrequest)
	req.URL.RawQuery = q.Encode()
	fmt.Println(req.URL.String())
	req.Header.Add("Authorization", "Bearer ")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("X-Accept", "application/json")
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error when sending request to the server")
	}
	defer resp.Body.Close()
	return json.NewDecoder(resp.Body).Decode(res)
}
func Askwit ( textrequest string , res interface { } ) error { req , err := http . NewRequest ( " " , " " , nil ) if err != nil { log . Print ( err ) os . Exit ( 1 ) } q := req . URL . Query ( ) q . Add ( " " , textrequest ) req . URL . RawQuery = q . Encode ( ) fmt . Println ( req . URL . String ( ) ) req . Header . Add ( " " , " " ) req . Header . Add ( " " , " " ) req . Header . Add ( " " , " " ) client := & http . Client { } resp , err := client . Do ( req ) if err != nil { fmt . Println ( " " ) } defer resp . Body . Close ( ) return json . NewDecoder ( resp . Body ) . Decode ( res ) }
Askwit is the function that sends the request to Wit.ai
Askwit is the function that sends the request to Wit . ai
//I prepare the request to send to wit.ai to interpret what is being said in Telegram