update method
Future<Guild>
update(
- Snowflake id,
- covariant GuildUpdateBuilder builder, {
- String? auditLogReason,
override
Update the item with the given id
in the API.
Implementers should ensure this method updates the cache.
Implementation
@override
Future<Guild> update(Snowflake id, GuildUpdateBuilder builder, {String? auditLogReason}) async {
final route = HttpRoute()..guilds(id: id.toString());
final request = BasicRequest(route, method: 'PATCH', auditLogReason: auditLogReason, body: jsonEncode(builder.build()));
final response = await client.httpHandler.executeSafe(request);
final guild = parse(response.jsonBody as Map<String, Object?>);
client.updateCacheWith(guild);
return guild;
}