Merge pull request #477 from sn0w/pr/476-remove-xkcd

Remove XKCDPass Invites
This commit is contained in:
Bruce 2017-11-11 14:22:42 -06:00 committed by GitHub
commit 07c1da20ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 11 deletions

View file

@ -1571,16 +1571,14 @@ func (s *Session) ChannelInvites(channelID string) (st []*Invite, err error) {
// ChannelInviteCreate creates a new invite for the given channel. // ChannelInviteCreate creates a new invite for the given channel.
// channelID : The ID of a Channel // channelID : The ID of a Channel
// i : An Invite struct with the values MaxAge, MaxUses, Temporary, // i : An Invite struct with the values MaxAge, MaxUses and Temporary defined.
// and XkcdPass defined.
func (s *Session) ChannelInviteCreate(channelID string, i Invite) (st *Invite, err error) { func (s *Session) ChannelInviteCreate(channelID string, i Invite) (st *Invite, err error) {
data := struct { data := struct {
MaxAge int `json:"max_age"` MaxAge int `json:"max_age"`
MaxUses int `json:"max_uses"` MaxUses int `json:"max_uses"`
Temporary bool `json:"temporary"` Temporary bool `json:"temporary"`
XKCDPass string `json:"xkcdpass"` }{i.MaxAge, i.MaxUses, i.Temporary}
}{i.MaxAge, i.MaxUses, i.Temporary, i.XkcdPass}
body, err := s.RequestWithBucketID("POST", EndpointChannelInvites(channelID), data, EndpointChannelInvites(channelID)) body, err := s.RequestWithBucketID("POST", EndpointChannelInvites(channelID), data, EndpointChannelInvites(channelID))
if err != nil { 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 // 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) { func (s *Session) Invite(inviteID string) (st *Invite, err error) {
body, err := s.RequestWithBucketID("GET", EndpointInvite(inviteID), nil, EndpointInvite("")) 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 // 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) { func (s *Session) InviteDelete(inviteID string) (st *Invite, err error) {
body, err := s.RequestWithBucketID("DELETE", EndpointInvite(inviteID), nil, EndpointInvite("")) 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 // 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) { func (s *Session) InviteAccept(inviteID string) (st *Invite, err error) {
body, err := s.RequestWithBucketID("POST", EndpointInvite(inviteID), nil, EndpointInvite("")) body, err := s.RequestWithBucketID("POST", EndpointInvite(inviteID), nil, EndpointInvite(""))

View file

@ -142,7 +142,6 @@ type Invite struct {
MaxAge int `json:"max_age"` MaxAge int `json:"max_age"`
Uses int `json:"uses"` Uses int `json:"uses"`
MaxUses int `json:"max_uses"` MaxUses int `json:"max_uses"`
XkcdPass string `json:"xkcdpass"`
Revoked bool `json:"revoked"` Revoked bool `json:"revoked"`
Temporary bool `json:"temporary"` Temporary bool `json:"temporary"`
} }