Remove XKCDPass Invites
This feature has been removed from the API quite some time ago.
This commit is contained in:
parent
9e1220d82b
commit
a838552b22
2 changed files with 5 additions and 8 deletions
12
restapi.go
12
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.
|
// 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(""))
|
||||||
|
|
|
@ -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"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue