Merge pull request #236 from jonas747/split
Added UserGuild struct, UserGuilds now returns a UserGuild slice
This commit is contained in:
commit
ef83d2098f
2 changed files with 11 additions and 2 deletions
|
@ -362,8 +362,8 @@ func (s *Session) UserChannelCreate(recipientID string) (st *Channel, err error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserGuilds returns an array of Guild structures for all guilds.
|
// UserGuilds returns an array of UserGuild 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)
|
body, err := s.Request("GET", EndpointUserGuilds("@me"), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -223,6 +223,15 @@ type Guild struct {
|
||||||
Unavailable bool `json:"unavailable"`
|
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
|
// A GuildParams stores all the data needed to update discord guild settings
|
||||||
type GuildParams struct {
|
type GuildParams struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
Loading…
Reference in a new issue