leave method

Future<void> leave()

Remove the discord client of this

Example :

await guild.leave();

Implementation

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

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