Jelajahi Sumber

Remove XKCDPass Invites

This feature has been removed from the API quite some time ago.
Lukas Breuer 7 tahun lalu
induk
melakukan
a838552b22
2 mengubah file dengan 5 tambahan dan 8 penghapusan
  1. 5 7
      restapi.go
  2. 0 1
      structs.go

+ 5 - 7
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(""))

+ 0 - 1
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"`
 }