delete method

  1. @override
Future<void> delete(
  1. Snowflake id
)
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) async {
  final route = HttpRoute()..applications(id: applicationId.toString());
  if (_guildId != null) route.guilds(id: _guildId!.toString());
  route.commands(id: id.toString());

  final request = BasicRequest(route, method: 'DELETE');

  await client.httpHandler.executeSafe(request);
  cache.remove(id);
}