update method
- Snowflake id,
- covariant RoleUpdateBuilder 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<Role> update(Snowflake id, RoleUpdateBuilder builder, {String? auditLogReason}) async {
final route = HttpRoute()
..guilds(id: guildId.toString())
..roles(id: id.toString());
final request = BasicRequest(route, method: 'PATCH', auditLogReason: auditLogReason, body: jsonEncode(builder.build()));
final response = await client.httpHandler.executeSafe(request);
final role = parse(response.jsonBody as Map<String, Object?>);
client.updateCacheWith(role);
return role;
}