change: make createInivte options optional

This commit is contained in:
ITOH
2021-05-22 18:03:28 +02:00
parent 5c6dd00a1e
commit b8f145f2d5

View File

@@ -6,7 +6,7 @@ import { endpoints } from "../../util/constants.ts";
import { requireBotChannelPermissions } from "../../util/permissions.ts";
/** Creates a new invite for this channel. Requires CREATE_INSTANT_INVITE */
export async function createInvite(channelId: bigint, options: CreateChannelInvite) {
export async function createInvite(channelId: bigint, options: CreateChannelInvite = {}) {
await requireBotChannelPermissions(channelId, ["CREATE_INSTANT_INVITE"]);
if (options.maxAge && (options.maxAge < 0 || options.maxAge > 604800)) {