leave method

Future<void> leave()

Remove the discord client of this

await guild.leave();

Implementation

Future<void> leave () async {
  Response response = await ioc.use<DiscordApiHttpService>().destroy(url: '/users/@me/guilds/$id').build();

  if (response.statusCode == 204) {
    MineralClient client = ioc.use<MineralClient>();
    client.guilds.cache.remove(this);
  }
}