Add Guild delete method (#15)
* Fix typo * Add guild delete method * Fix Shard crash on guild delete
This commit is contained in:
parent
3ef9e16d03
commit
d827ecdda6
|
@ -1,3 +1,3 @@
|
|||
# Contributing
|
||||
If you want to contribute, feel free to fork and make a PR. Please lint ant run `dartfmt` before opening a PR.
|
||||
If you want to contribute, feel free to fork and make a PR. Please lint and run `dartfmt` before opening a PR.
|
||||
And make sure to always make your PRs to `indev`.
|
|
@ -285,4 +285,10 @@ class Guild {
|
|||
});
|
||||
return map;
|
||||
}
|
||||
|
||||
/// Deletes the guild.
|
||||
Future<Null> delete() async {
|
||||
await this._client.http.send('DELETE', "/guilds/${this.id}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ class Shard {
|
|||
break;
|
||||
|
||||
case 'GUILD_DELETE':
|
||||
if (json['d']['unavailable']) {
|
||||
if (json['d']['unavailable'] == true) {
|
||||
new GuildUnavailableEvent._new(this._ws.client, json);
|
||||
} else {
|
||||
new GuildDeleteEvent._new(this._ws.client, json, this);
|
||||
|
|
Loading…
Reference in a new issue