diff --git a/api/invite.go b/api/invite.go index cf7c536..df66854 100644 --- a/api/invite.go +++ b/api/invite.go @@ -9,12 +9,28 @@ 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 params struct { + WithCounts bool `schema:"with_counts"` + } + + params.WithCounts = false + + 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