1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-09-28 21:29:25 +00:00

Merge pull request #59 from mavolin/47-invite

This commit is contained in:
diamondburned 2020-05-11 20:12:06 -07:00 committed by GitHub
commit b453e3c0af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,12 +9,22 @@ import (
var EndpointInvites = Endpoint + "invites/"
// Invite returns an invite object for the given code.
//
// ApproxMembers will not get filled.
func (c *Client) Invite(code string) (*discord.Invite, error) {
var inv *discord.Invite
return inv, c.RequestJSON(
&inv, "GET",
EndpointInvites+code,
)
}
// Invite returns an invite object for the given code and fills ApproxMembers.
func (c *Client) InviteWithCounts(code string) (*discord.Invite, error) {
var params struct {
WithCounts bool `schema:"with_counts,omitempty"`
}
// Nothing says I can't!
params.WithCounts = true
var inv *discord.Invite