added create date calculator for channel.

This commit is contained in:
5elenay
2021-08-22 17:45:45 +03:00
parent f80532ef53
commit b7cc1c0d5f
6 changed files with 35 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ package revoltgo
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
@@ -26,6 +27,10 @@ func (c Client) Request(method, path string, data []byte) ([]byte, error) {
return []byte{}, err
}
if !(resp.StatusCode >= 200 && resp.StatusCode < 300) {
return []byte{}, fmt.Errorf(resp.Status)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)