Support new leave API.
This commit is contained in:
parent
bf3f2c548a
commit
0bd7fbf668
2 changed files with 10 additions and 1 deletions
|
@ -50,6 +50,7 @@ var (
|
|||
USER_AVATAR = func(uID, aID string) string { return USERS + uID + "/avatars/" + aID + ".jpg" }
|
||||
USER_SETTINGS = func(uID string) string { return USERS + uID + "/settings" }
|
||||
USER_GUILDS = func(uID string) string { return USERS + uID + "/guilds" }
|
||||
USER_GUILD = func(uID, gID string) string { return USERS + uID + "/guilds/" + gID }
|
||||
USER_CHANNELS = func(uID string) string { return USERS + uID + "/channels" }
|
||||
USER_DEVICES = func(uID string) string { return USERS + uID + "/devices" }
|
||||
USER_CONNECTIONS = func(uID string) string { return USERS + uID + "/connections" }
|
||||
|
|
10
restapi.go
10
restapi.go
|
@ -390,7 +390,7 @@ func (s *Session) GuildEdit(guildID, name string) (st *Guild, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// GuildDelete deletes or leaves a Guild.
|
||||
// GuildDelete deletes a Guild.
|
||||
// guildID : The ID of a Guild
|
||||
func (s *Session) GuildDelete(guildID string) (st *Guild, err error) {
|
||||
|
||||
|
@ -403,6 +403,14 @@ func (s *Session) GuildDelete(guildID string) (st *Guild, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// GuildLeave leaves a Guild.
|
||||
// guildID : The ID of a Guild
|
||||
func (s *Session) GuildLeave(guildID string) (st *Guild, err error) {
|
||||
|
||||
_, err := s.Request("DELETE", USER_GUILD("@me", guildID), nil)
|
||||
return
|
||||
}
|
||||
|
||||
// GuildBans returns an array of User structures for all bans of a
|
||||
// given guild.
|
||||
// guildID : The ID of a Guild.
|
||||
|
|
Loading…
Reference in a new issue