Added role.delete()

This commit is contained in:
Amish Shah
2016-07-03 13:04:39 +01:00
parent 849b8df2da
commit 3cd91a19aa
10 changed files with 141 additions and 83 deletions

View File

@@ -248,8 +248,8 @@ class RESTMethods{
this.rest.makeRequest('del', Constants.Endpoints.GUILD_MEMBER(guild.id, member.id), true)
.then(() => {
resolve(this.rest.client.actions.GuildMemberRemove.handle({
guild_id : guild.id,
user : member.user,
guild_id: guild.id,
user: member.user,
}).m);
})
.catch(reject);
@@ -261,13 +261,26 @@ class RESTMethods{
this.rest.makeRequest('post', Constants.Endpoints.GUILD_ROLES(guild.id), true)
.then(role => {
resolve(this.rest.client.actions.GuildRoleCreate.handle({
guild_id : guild.id,
guild_id: guild.id,
role,
}).role);
})
.catch(reject);
});
}
DeleteGuildRole(role) {
return new Promise((resolve, reject) => {
this.rest.makeRequest('del', Constants.Endpoints.GUILD_ROLE(role.guild.id, role.id), true)
.then(() => {
resolve(this.rest.client.actions.GuildRoleDelete.handle({
guild_id: role.guild.id,
role_id: role.id,
}).role);
})
.catch(reject);
});
}
}
module.exports = RESTMethods;