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