getinvites add options

This commit is contained in:
ITOH
2021-05-04 22:12:04 +02:00
parent 09d6177b5f
commit b0ea2549ad
+4 -1
View File
@@ -1,11 +1,14 @@
import { rest } from "../../rest/rest.ts";
import { GetInvite } from "../../types/invites/get_invite.ts";
import type { Invite } from "../../types/invites/invite.ts";
import { endpoints } from "../../util/constants.ts";
import { camelKeysToSnakeCase } from "../../util/utils.ts";
/** Returns an invite for the given code or throws an error if the invite doesn't exists. */
export async function getInvite(inviteCode: string) {
export async function getInvite(inviteCode: string, options: GetInvite) {
return await rest.runMethod<Invite>(
"get",
endpoints.INVITE(inviteCode),
camelKeysToSnakeCase(options),
);
}