mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-01-07 12:38:05 +00:00
API: implement #47
This commit is contained in:
parent
323dc2193e
commit
56f7601547
|
@ -9,12 +9,28 @@ import (
|
||||||
var EndpointInvites = Endpoint + "invites/"
|
var EndpointInvites = Endpoint + "invites/"
|
||||||
|
|
||||||
// Invite returns an invite object for the given code.
|
// Invite returns an invite object for the given code.
|
||||||
|
//
|
||||||
|
// ApproxMembers will not get filled.
|
||||||
func (c *Client) Invite(code string) (*discord.Invite, error) {
|
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 {
|
var params struct {
|
||||||
WithCounts bool `schema:"with_counts,omitempty"`
|
WithCounts bool `schema:"with_counts,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nothing says I can't!
|
|
||||||
params.WithCounts = true
|
params.WithCounts = true
|
||||||
|
|
||||||
var inv *discord.Invite
|
var inv *discord.Invite
|
||||||
|
|
Loading…
Reference in a new issue