delete method

Future<void> delete()

Removes the current this from the EmojiManager's cache

Example :

final Emoji? emoji = guild.emojis.cache.get('240561194958716924');
if (emoji != null) {
  await emoji.delete();
}

You can specify a reason for this action

Example :

await emoji.delete(reason: 'I will destroy this..');

Implementation

Future<void> delete () async {
  Response response = await ioc.use<HttpService>().destroy(url: "/guilds/${manager.guild.id}/emojis/$id");

  if (response.statusCode == 200) {
    manager.cache.remove(id);
  }
}