1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-05 19:57:02 +00:00

API: implement #47

This commit is contained in:
mavolin 2020-05-12 04:57:43 +02:00
parent 323dc2193e
commit 56f7601547
No known key found for this signature in database
GPG key ID: D8681218EDF216DF

View file

@ -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