lets all be friendly! (#809)

* lets all be friendly!

* fix doc

* Update ClientUser.js

* Update ClientUser.js
This commit is contained in:
Gus Caplan
2016-10-18 00:36:25 -05:00
committed by Schuyler Cebulskie
parent 2f2188fe60
commit 9c8eb2dfc3
4 changed files with 44 additions and 1 deletions

View File

@@ -638,6 +638,26 @@ class RESTMethods {
}).catch(reject);
});
}
addFriend(user) {
return new Promise((resolve, reject) => {
this.rest.makeRequest('post', Constants.Endpoints.relationships('@me'), true, {
discriminator: user.discriminator,
username: user.username,
}).then(() => {
resolve(user);
}).catch(reject);
});
}
removeFriend(user) {
return new Promise((resolve, reject) => {
this.rest.makeRequest('delete', `${Constants.Endpoints.relationships('@me')}/${user.id}`, true)
.then(() => {
resolve(user);
}).catch(reject);
});
}
}
module.exports = RESTMethods;