async function createInvite(
  channelId,
  options,
) {
  await requireBotChannelPermissions(channelId, [
    "CREATE_INSTANT_INVITE",
  ]);
  if (options.maxAge && (options.maxAge < 0 || options.maxAge > 604800)) {
    throw new Error(Errors.INVITE_MAX_AGE_INVALID);
  }
  if (options.maxUses && (options.maxUses < 0 || options.maxUses > 100)) {
    throw new Error(Errors.INVITE_MAX_USES_INVALID);
  }
  return await rest.runMethod(
    "post",
    endpoints.CHANNEL_INVITES(channelId),
    options,
  );
}
/** Creates a new invite for this channel. Requires CREATE_INSTANT_INVITE */
Creates a new invite for this channel.
Creates a new invite for this channel .
async function createInvite(
  channelId,
  options,
) {
  await requireBotChannelPermissions(channelId, [
    "CREATE_INSTANT_INVITE",
  ]);
  if (options.maxAge && (options.maxAge < 0 || options.maxAge > 604800)) {
    throw new Error(Errors.INVITE_MAX_AGE_INVALID);
  }
  if (options.maxUses && (options.maxUses < 0 || options.maxUses > 100)) {
    throw new Error(Errors.INVITE_MAX_USES_INVALID);
  }
  return await rest.runMethod(
    "post",
    endpoints.CHANNEL_INVITES(channelId),
    options,
  );
}
async function createInvite ( channelId , options , ) { await requireBotChannelPermissions ( channelId , [ "CREATE_INSTANT_INVITE" , ] ) ; if ( options . maxAge && ( options . maxAge < 0 || options . maxAge > 604800 ) ) { throw new Error ( Errors . INVITE_MAX_AGE_INVALID ) ; } if ( options . maxUses && ( options . maxUses < 0 || options . maxUses > 100 ) ) { throw new Error ( Errors . INVITE_MAX_USES_INVALID ) ; } return await rest . runMethod ( "post" , endpoints . CHANNEL_INVITES ( channelId ) , options , ) ; }
Creates a new invite for this channel.
Creates a new invite for this channel .