Skip to content

Commit

Permalink
feat(UserUpdate): add banner support
Browse files Browse the repository at this point in the history
  • Loading branch information
FedorLap2006 committed Mar 15, 2024
1 parent 33ee38c commit 9a7f8e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions restapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (s *Session) UserAvatarDecode(u *User, options ...RequestOption) (img image
}

// UserUpdate updates current user settings.
func (s *Session) UserUpdate(username, avatar string, options ...RequestOption) (st *User, err error) {
func (s *Session) UserUpdate(username, avatar, banner string, options ...RequestOption) (st *User, err error) {

// NOTE: Avatar must be either the hash/id of existing Avatar or
// data:image/png;base64,BASE64_STRING_OF_NEW_AVATAR_PNG
Expand All @@ -368,7 +368,8 @@ func (s *Session) UserUpdate(username, avatar string, options ...RequestOption)
data := struct {
Username string `json:"username,omitempty"`
Avatar string `json:"avatar,omitempty"`
}{username, avatar}
Banner string `json:"banner,omitempty"`
}{username, avatar, banner}

body, err := s.RequestWithBucketID("PATCH", EndpointUser("@me"), data, EndpointUsers, options...)
if err != nil {
Expand Down

0 comments on commit 9a7f8e5

Please sign in to comment.