From 7bcc0fbaca1d1d7247376a357dc46fa65df9bca1 Mon Sep 17 00:00:00 2001 From: LEGOlord208 Date: Wed, 12 Apr 2017 06:51:24 +0200 Subject: [PATCH] Added more fields (#354) * Added more fields * Fixed error * Yep ok --- restapi.go | 8 +------- structs.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/restapi.go b/restapi.go index aa4efc9..463bab4 100644 --- a/restapi.go +++ b/restapi.go @@ -611,13 +611,7 @@ func (s *Session) GuildEdit(guildID string, g GuildParams) (st *Guild, err error } } - data := struct { - Name string `json:"name,omitempty"` - Region string `json:"region,omitempty"` - VerificationLevel *VerificationLevel `json:"verification_level,omitempty"` - }{g.Name, g.Region, g.VerificationLevel} - - body, err := s.RequestWithBucketID("PATCH", EndpointGuild(guildID), data, EndpointGuild(guildID)) + body, err := s.RequestWithBucketID("PATCH", EndpointGuild(guildID), g, EndpointGuild(guildID)) if err != nil { return } diff --git a/structs.go b/structs.go index 12463d6..b0aadf8 100644 --- a/structs.go +++ b/structs.go @@ -233,9 +233,15 @@ type UserGuild struct { // A GuildParams stores all the data needed to update discord guild settings type GuildParams struct { - Name string `json:"name"` - Region string `json:"region"` - VerificationLevel *VerificationLevel `json:"verification_level"` + Name string `json:"name,omitempty"` + Region string `json:"region,omitempty"` + VerificationLevel *VerificationLevel `json:"verification_level,omitempty"` + DefaultMessageNotifications int `json:"default_message_notifications,omitempty"` // TODO: Separate type? + AfkChannelID string `json:"afk_channel_id,omitempty"` + AfkTimeout int `json:"afk_timeout,omitempty"` + Icon string `json:"icon,omitempty"` + OwnerID string `json:"owner_id,omitempty"` + Splash string `json:"splash,omitempty"` } // A Role stores information about Discord guild member roles.