updateStageInstance method

Future<StageInstance> updateStageInstance(
  1. Snowflake channelId,
  2. StageInstanceUpdateBuilder builder, {
  3. String? auditLogReason,
})

Update the stage instance for a channel.

Implementation

Future<StageInstance> updateStageInstance(Snowflake channelId, StageInstanceUpdateBuilder builder, {String? auditLogReason}) async {
  final route = HttpRoute()..stageInstances(id: channelId.toString());
  final request = BasicRequest(
    route,
    method: 'PATCH',
    body: jsonEncode(builder.build()),
    auditLogReason: auditLogReason,
  );

  final response = await client.httpHandler.executeSafe(request);
  final stageInstance = parseStageInstance(response.jsonBody as Map<String, Object?>);

  client.updateCacheWith(stageInstance);
  return stageInstance;
}