From f1416669fd3fb86503067d2b672dd474604881bd Mon Sep 17 00:00:00 2001 From: Ben Forster <109809772+ben-forster@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:17:15 +0100 Subject: [PATCH] bump go version & --- http.go | 4 ++-- server.go | 45 +++++++++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/http.go b/http.go index 34ef981..c7b601b 100644 --- a/http.go +++ b/http.go @@ -3,7 +3,7 @@ package revgo import ( "bytes" "fmt" - "io/ioutil" + "io" "net/http" ) @@ -34,7 +34,7 @@ func (c Client) Request(method, path string, data []byte) ([]byte, error) { } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return []byte{}, err diff --git a/server.go b/server.go index 8b25ab7..7bcb76f 100644 --- a/server.go +++ b/server.go @@ -12,20 +12,37 @@ import ( type Server struct { Client *Client CreatedAt time.Time - - Id string `json:"_id"` - Nonce string `json:"nonce"` - OwnerId string `json:"owner"` - Name string `json:"name"` - Description string `json:"description"` - ChannelIds []string `json:"channels"` - Categories []*ServerCategory `json:"categories"` - SystemMessages *SystemMessages `json:"system_messages"` - Roles map[string]interface{} `json:"roles"` - DefaultPermissions []string `json:"default_permissions"` - Icon *Attachment `json:"icon"` - Banner *Attachment `json:"banner"` -} + + Id string `json:"_id"` + Nonce string `json:"nonce"` + OwnerId string `json:"owner"` + Name string `json:"name"` + + // Description of the server. + Description string `json:"description"` + + // IDs of the channels in the server. + ChannelIds []string `json:"channels"` + + // Categories of the server. + Categories []*ServerCategory `json:"categories"` + + // System messages of the server. + SystemMessages *SystemMessages `json:"system_messages"` + + // Roles of the server. + Roles map[string]interface{} `json:"roles"` + + // Default permissions of the server. + DefaultPermissions []interface{} `json:"default_permissions"` + + // Icon of the server. + Icon *Attachment `json:"icon"` + + // Banner of the server. + Banner *Attachment `json:"banner"` + } + // Server categories struct. type ServerCategory struct {