async function updateStageInstance(
  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, [
      "MOVE_MEMBERS",
      "MUTE_MEMBERS",
      "MANAGE_CHANNELS",
    ]);
  }
  if (
    !validateLength(topic, {
      min: 1,
      max: 120,
    })
  ) {
    throw new Error(Errors.INVALID_TOPIC_LENGTH);
  }
  return await rest.runMethod("patch", endpoints.STAGE_INSTANCE(channelId), {
    topic,
  });
}
/** Updates fields of an existing Stage instance. Requires the user to be a moderator of the Stage channel. */
Updates fields of an existing Stage instance. Requires the user to be a moderator of the Stage channel.
Updates fields of an existing Stage instance . Requires the user to be a moderator of the Stage channel .
async function updateStageInstance(
  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, [
      "MOVE_MEMBERS",
      "MUTE_MEMBERS",
      "MANAGE_CHANNELS",
    ]);
  }
  if (
    !validateLength(topic, {
      min: 1,
      max: 120,
    })
  ) {
    throw new Error(Errors.INVALID_TOPIC_LENGTH);
  }
  return await rest.runMethod("patch", endpoints.STAGE_INSTANCE(channelId), {
    topic,
  });
}
async function updateStageInstance ( 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 , [ "MOVE_MEMBERS" , "MUTE_MEMBERS" , "MANAGE_CHANNELS" , ] ) ; } if ( ! validateLength ( topic , { min : 1 , max : 120 , } ) ) { throw new Error ( Errors . INVALID_TOPIC_LENGTH ) ; } return await rest . runMethod ( "patch" , endpoints . STAGE_INSTANCE ( channelId ) , { topic , } ) ; }
Updates fields of an existing Stage instance.
Updates fields of an existing Stage instance .