fetchGuildChannels method

Future<List<GuildChannel>> fetchGuildChannels(
  1. Snowflake id
)

Fetch the channels in a guild.

Implementation

Future<List<GuildChannel>> fetchGuildChannels(Snowflake id) async {
  final route = HttpRoute()
    ..guilds(id: id.toString())
    ..channels();
  final request = BasicRequest(route);

  final response = await client.httpHandler.executeSafe(request);
  final channels = parseMany(response.jsonBody as List, client.channels.parse).cast<GuildChannel>();

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