async function createStageInstance(
  channelId,
  topic,
) {
  const channel = await cacheHandlers.get("channels", channelId);
  if (channel) {
    if (channel.type !== ChannelTypes.GuildStageVoice) {
      throw new Error(Errors.CHANNEL_NOT_STAGE_VOICE);
    }
    await requireBotChannelPermissions(channel, [
      "MANAGE_CHANNELS",
      "MUTE_MEMBERS",
      "MOVE_MEMBERS",
    ]);
  }
  if (
    !validateLength(topic, {
      max: 120,
      min: 1,
    })
  ) {
    throw new Error(Errors.INVALID_TOPIC_LENGTH);
  }
  return await rest.runMethod("post", endpoints.STAGE_INSTANCES, {
    "channel_id": channelId,
    topic,
  });
}
/** Creates a new Stage instance associated to a Stage channel. Requires the user to be a moderator of the Stage channel. */
Creates a new Stage instance associated to a Stage channel. Requires the user to be a moderator of the Stage channel.
Creates a new Stage instance associated to a Stage channel . Requires the user to be a moderator of the Stage channel .
async function createStageInstance(
  channelId,
  topic,
) {
  const channel = await cacheHandlers.get("channels", channelId);
  if (channel) {
    if (channel.type !== ChannelTypes.GuildStageVoice) {
      throw new Error(Errors.CHANNEL_NOT_STAGE_VOICE);
    }
    await requireBotChannelPermissions(channel, [
      "MANAGE_CHANNELS",
      "MUTE_MEMBERS",
      "MOVE_MEMBERS",
    ]);
  }
  if (
    !validateLength(topic, {
      max: 120,
      min: 1,
    })
  ) {
    throw new Error(Errors.INVALID_TOPIC_LENGTH);
  }
  return await rest.runMethod("post", endpoints.STAGE_INSTANCES, {
    "channel_id": channelId,
    topic,
  });
}
async function createStageInstance ( channelId , topic , ) { const channel = await cacheHandlers . get ( "channels" , channelId ) ; if ( channel ) { if ( channel . type !== ChannelTypes . GuildStageVoice ) { throw new Error ( Errors . CHANNEL_NOT_STAGE_VOICE ) ; } await requireBotChannelPermissions ( channel , [ "MANAGE_CHANNELS" , "MUTE_MEMBERS" , "MOVE_MEMBERS" , ] ) ; } if ( ! validateLength ( topic , { max : 120 , min : 1 , } ) ) { throw new Error ( Errors . INVALID_TOPIC_LENGTH ) ; } return await rest . runMethod ( "post" , endpoints . STAGE_INSTANCES , { "channel_id" : channelId , topic , } ) ; }
Creates a new Stage instance associated to a Stage channel.
Creates a new Stage instance associated to a Stage channel .