createGuildChannel<T extends GuildChannel> method
- Snowflake id,
- GuildChannelBuilder<
T> builder, - {String? auditLogReason}
Create a channel in a guild.
Implementation
Future<T> createGuildChannel<T extends GuildChannel>(Snowflake id, GuildChannelBuilder<T> builder, {String? auditLogReason}) async {
final route = HttpRoute()
..guilds(id: id.toString())
..channels();
final request = BasicRequest(route, method: 'POST', auditLogReason: auditLogReason, body: jsonEncode(builder.build()));
final response = await client.httpHandler.executeSafe(request);
final channel = client.channels.parse(response.jsonBody as Map<String, Object?>) as T;
client.updateCacheWith(channel);
return channel;
}