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