func (b *Bot) requestResponseString(method string, params map[string]interface{}) (result APIResponseString) {
	var errStr string

	if bytes, err := b.request(method, params); err == nil {
		var jsonResponse APIResponseString
		err = json.Unmarshal(bytes, &jsonResponse)
		if err == nil {
			return jsonResponse
		}

		errStr = fmt.Sprintf("json parse error: %s (%s)", err, string(bytes))
	} else {
		errStr = fmt.Sprintf("%s failed with error: %s", method, err)
	}

	b.error(errStr)

	return APIResponseString{APIResponseBase: APIResponseBase{Ok: false, Description: &errStr}}
}
// Send request for APIResponseString and fetch its result.
Send request for APIResponseString and fetch its result.
// Send request for APIResponseString and fetch its result .
func (b *Bot) requestResponseString(method string, params map[string]interface{}) (result APIResponseString) {
	var errStr string
	if bytes, err := b.request(method, params); err == nil {
		var jsonResponse APIResponseString
		err = json.Unmarshal(bytes, &jsonResponse)
		if err == nil {
			return jsonResponse
		}
		errStr = fmt.Sprintf("json parse error: %s (%s)", err, string(bytes))
	} else {
		errStr = fmt.Sprintf("%s failed with error: %s", method, err)
	}
	b.error(errStr)
	return APIResponseString{APIResponseBase: APIResponseBase{Ok: false, Description: &errStr}}
}
func ( b * Bot ) requestResponseString ( method string , params map [ string ] interface { } ) ( result APIResponseString ) { var errStr string if bytes , err := b . request ( method , params ) ; err == nil { var jsonResponse APIResponseString err = json . Unmarshal ( bytes , & jsonResponse ) if err == nil { return jsonResponse } errStr = fmt . Sprintf ( " " , err , string ( bytes ) ) } else { errStr = fmt . Sprintf ( " " , method , err ) } b . error ( errStr ) return APIResponseString { APIResponseBase : APIResponseBase { Ok : false , Description : & errStr } } }
Send request for APIResponseString and fetch its result.
Send request for APIResponseString and fetch its result .