update method
- Snowflake id,
- UpdateBuilder<
Channel> builder, - {String? auditLogReason}
Update a channel using the provided builder
.
Implementation
Future<Channel> update(Snowflake id, UpdateBuilder<Channel> builder, {String? auditLogReason}) async {
final route = HttpRoute()..channels(id: id.toString());
final request = BasicRequest(
route,
method: 'PATCH',
body: jsonEncode(builder.build()),
auditLogReason: auditLogReason,
);
final response = await client.httpHandler.executeSafe(request);
final channel = parse(response.jsonBody as Map<String, Object?>);
client.updateCacheWith(channel);
return channel;
}