mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-10-31 20:14:21 +00:00
API: Added JoinInvite
This commit is contained in:
parent
05de2d7b61
commit
700b55102d
|
@ -91,6 +91,21 @@ func (c *Client) CreateInvite(
|
|||
)
|
||||
}
|
||||
|
||||
// JoinedInvite is returned after joining an invite.
|
||||
type JoinedInvite struct {
|
||||
Code string `json:"code"`
|
||||
NewMember bool `json:"new_member"`
|
||||
Guild discord.Guild `json:"guild"`
|
||||
Channel discord.Channel `json:"channel"` // id, name, type only
|
||||
}
|
||||
|
||||
// JoinInvite joins a guild using the given invite code. This endpoint is
|
||||
// undocumented.
|
||||
func (c *Client) JoinInvite(code string) (*JoinedInvite, error) {
|
||||
var inv *JoinedInvite
|
||||
return inv, c.RequestJSON(&inv, "POST", EndpointInvites+code)
|
||||
}
|
||||
|
||||
// DeleteInvite deletes an invite.
|
||||
//
|
||||
// Requires the MANAGE_CHANNELS permission on the channel this invite belongs
|
||||
|
|
Loading…
Reference in a new issue