mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
invites
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { DiscordInvite, Invite } from "../../types/invites/invite.ts";
|
||||
import { Invite } from "../../types/invites/invite.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { snakeKeysToCamelCase } 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) {
|
||||
const result: DiscordInvite = await rest.runMethod(
|
||||
return await rest.runMethod<Invite>(
|
||||
"get",
|
||||
endpoints.INVITE(inviteCode),
|
||||
);
|
||||
|
||||
return snakeKeysToCamelCase<Invite>(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user