Add GuildMember.addRole/addRoles (#615)

* Add GuildMember.addRole/addRoles

* Add GuildMember.removeRole/removeRoles
This commit is contained in:
Schuyler Cebulskie
2016-09-05 02:18:51 -04:00
committed by Amish Shah
parent e87c9bb9a0
commit dc7b07022c
3 changed files with 59 additions and 6 deletions

View File

@@ -307,10 +307,7 @@ class RESTMethods {
updateGuildMember(member, data) {
return new Promise((resolve, reject) => {
if (data.channel) data.channel_id = this.rest.client.resolver.resolveChannel(data.channel).id;
if (data.roles) {
if (data.roles instanceof Collection) data.roles = data.roles.array();
data.roles = data.roles.map(role => role instanceof Role ? role.id : role);
}
if (data.roles) data.roles = data.roles.map(role => role instanceof Role ? role.id : role);
let endpoint = Constants.Endpoints.guildMember(member.guild.id, member.id);
// fix your endpoints, discord ;-;