From a838552b223cc33c4a975da39298e8dc3e6698e4 Mon Sep 17 00:00:00 2001 From: Lukas Breuer Date: Sat, 11 Nov 2017 18:02:17 +0100 Subject: [PATCH 1/2] Remove XKCDPass Invites This feature has been removed from the API quite some time ago. --- restapi.go | 12 +++++------- structs.go | 1 - 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/restapi.go b/restapi.go index 52ca3f6..ebf3f18 100644 --- a/restapi.go +++ b/restapi.go @@ -1571,16 +1571,14 @@ func (s *Session) ChannelInvites(channelID string) (st []*Invite, err error) { // ChannelInviteCreate creates a new invite for the given channel. // channelID : The ID of a Channel -// i : An Invite struct with the values MaxAge, MaxUses, Temporary, -// and XkcdPass defined. +// i : An Invite struct with the values MaxAge, MaxUses and Temporary defined. func (s *Session) ChannelInviteCreate(channelID string, i Invite) (st *Invite, err error) { data := struct { MaxAge int `json:"max_age"` MaxUses int `json:"max_uses"` Temporary bool `json:"temporary"` - XKCDPass string `json:"xkcdpass"` - }{i.MaxAge, i.MaxUses, i.Temporary, i.XkcdPass} + }{i.MaxAge, i.MaxUses, i.Temporary} body, err := s.RequestWithBucketID("POST", EndpointChannelInvites(channelID), data, EndpointChannelInvites(channelID)) if err != nil { @@ -1620,7 +1618,7 @@ func (s *Session) ChannelPermissionDelete(channelID, targetID string) (err error // ------------------------------------------------------------------------------------------------ // Invite returns an Invite structure of the given invite -// inviteID : The invite code (or maybe xkcdpass?) +// inviteID : The invite code func (s *Session) Invite(inviteID string) (st *Invite, err error) { body, err := s.RequestWithBucketID("GET", EndpointInvite(inviteID), nil, EndpointInvite("")) @@ -1633,7 +1631,7 @@ func (s *Session) Invite(inviteID string) (st *Invite, err error) { } // InviteDelete deletes an existing invite -// inviteID : the code (or maybe xkcdpass?) of an invite +// inviteID : the code of an invite func (s *Session) InviteDelete(inviteID string) (st *Invite, err error) { body, err := s.RequestWithBucketID("DELETE", EndpointInvite(inviteID), nil, EndpointInvite("")) @@ -1646,7 +1644,7 @@ func (s *Session) InviteDelete(inviteID string) (st *Invite, err error) { } // InviteAccept accepts an Invite to a Guild or Channel -// inviteID : The invite code (or maybe xkcdpass?) +// inviteID : The invite code func (s *Session) InviteAccept(inviteID string) (st *Invite, err error) { body, err := s.RequestWithBucketID("POST", EndpointInvite(inviteID), nil, EndpointInvite("")) diff --git a/structs.go b/structs.go index 198ff79..e24c9a8 100644 --- a/structs.go +++ b/structs.go @@ -142,7 +142,6 @@ type Invite struct { MaxAge int `json:"max_age"` Uses int `json:"uses"` MaxUses int `json:"max_uses"` - XkcdPass string `json:"xkcdpass"` Revoked bool `json:"revoked"` Temporary bool `json:"temporary"` } From 1b69ba4a5fc39d7a46cd7d6a171015c89c9a2a2c Mon Sep 17 00:00:00 2001 From: Lukas Breuer Date: Sat, 11 Nov 2017 19:48:26 +0100 Subject: [PATCH 2/2] Format restapi.go with gofmt --- restapi.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/restapi.go b/restapi.go index ebf3f18..3ab9164 100644 --- a/restapi.go +++ b/restapi.go @@ -1575,9 +1575,9 @@ func (s *Session) ChannelInvites(channelID string) (st []*Invite, err error) { func (s *Session) ChannelInviteCreate(channelID string, i Invite) (st *Invite, err error) { data := struct { - MaxAge int `json:"max_age"` - MaxUses int `json:"max_uses"` - Temporary bool `json:"temporary"` + MaxAge int `json:"max_age"` + MaxUses int `json:"max_uses"` + Temporary bool `json:"temporary"` }{i.MaxAge, i.MaxUses, i.Temporary} body, err := s.RequestWithBucketID("POST", EndpointChannelInvites(channelID), data, EndpointChannelInvites(channelID))