Added Guild Deletion

This commit is contained in:
hydrabolt
2016-05-01 14:51:46 +01:00
parent 3a0426482e
commit f95c588d87
12 changed files with 129 additions and 26 deletions

View File

@@ -111,6 +111,27 @@ class RESTMethods{
.catch(reject);
});
}
LeaveGuild(guild) {
return new Promise((resolve, reject) => {
this.rest.makeRequest('del', Constants.Endpoints.ME_GUILD(guild.id), true)
.then(() => {
resolve(this.rest.client.actions.GuildDelete.handle({ id:guild.id }).guild);
})
.catch(reject);
});
}
// untested but probably will work
DeleteGuild(guild) {
return new Promise((resolve, reject) => {
this.rest.makeRequest('del', Constants.Endpoints.GUILD(guild.id), true)
.then(() => {
resolve(this.rest.client.actions.GuildDelete.handle({ id:guild.id }).guild);
})
.catch(reject);
});
}
}
module.exports = RESTMethods;