fetchStageInstance method

Future<StageInstance> fetchStageInstance(
  1. Snowflake channelId
)

Fetch the current stage instance for a channel.

Implementation

Future<StageInstance> fetchStageInstance(Snowflake channelId) async {
  final route = HttpRoute()..stageInstances(id: channelId.toString());
  final request = BasicRequest(route);

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

  client.updateCacheWith(stageInstance);
  return stageInstance;
}