fetchChannelWebhooks method

Future<List<Webhook>> fetchChannelWebhooks(
  1. Snowflake channelId
)

Fetch the webhooks in a channel.

Implementation

Future<List<Webhook>> fetchChannelWebhooks(Snowflake channelId) async {
  final route = HttpRoute()
    ..channels(id: channelId.toString())
    ..webhooks();
  final request = BasicRequest(route);

  final response = await client.httpHandler.executeSafe(request);
  final webhooks = parseMany(response.jsonBody as List, parse);

  webhooks.forEach(client.updateCacheWith);
  return webhooks;
}