delete method

  1. @override
Future<void> delete(
  1. Snowflake id, {
  2. String? auditLogReason,
})
override

Delete the item with the given id from the API.

Implementers should ensure this method updates the cache.

Implementation

@override
Future<void> delete(Snowflake id, {String? auditLogReason}) async {
  final route = HttpRoute()
    ..guilds(id: guildId.toString())
    ..autoModeration()
    ..rules(id: id.toString());
  final request = BasicRequest(route, method: 'DELETE', auditLogReason: auditLogReason);

  await client.httpHandler.executeSafe(request);

  cache.remove(id);
}