Skip to content

Commit

Permalink
bump go version &
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-forster committed Apr 25, 2023
1 parent 00bbb3e commit f141666
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
4 changes: 2 additions & 2 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package revgo
import (
"bytes"
"fmt"
"io/ioutil"
"io"
"net/http"
)

Expand Down Expand Up @@ -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
Expand Down
45 changes: 31 additions & 14 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f141666

Please sign in to comment.