forked from pothtonswer/discordmuffin
Merge pull request #477 from sn0w/pr/476-remove-xkcd
Remove XKCDPass Invites
This commit is contained in:
commit
07c1da20ff
2 changed files with 8 additions and 11 deletions
18
restapi.go
18
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}
|
||||
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))
|
||||
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(""))
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue