From 3fd53413deb184c9636bd70bcd3dbe34c291f95d Mon Sep 17 00:00:00 2001 From: jonas747 Date: Fri, 29 Jul 2016 23:13:55 +0200 Subject: [PATCH] Added userguild struct, and UserGuilds() now returns a userguild --- restapi.go | 2 +- structs.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/restapi.go b/restapi.go index bf5065b..b2faac1 100644 --- a/restapi.go +++ b/restapi.go @@ -351,7 +351,7 @@ func (s *Session) UserChannelCreate(recipientID string) (st *Channel, err error) } // UserGuilds returns an array of Guild structures for all guilds. -func (s *Session) UserGuilds() (st []*Guild, err error) { +func (s *Session) UserGuilds() (st []*UserGuild, err error) { body, err := s.Request("GET", EndpointUserGuilds("@me"), nil) if err != nil { diff --git a/structs.go b/structs.go index 19a291f..c9d54db 100644 --- a/structs.go +++ b/structs.go @@ -220,6 +220,15 @@ type Guild struct { Unavailable *bool `json:"unavailable"` } +// A UserGuild holds a brief version of a Guild +type UserGuild struct { + ID string `json:"id"` + Name string `json:"name"` + Icon string `json:"icon"` + Owner bool `json:"owner"` + Permissions int `json:"permissions"` +} + // A GuildParams stores all the data needed to update discord guild settings type GuildParams struct { Name string `json:"name"`