mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Add client.cacheUser method (#548)
* Add client.cacheUser method * Fixed ESLint issues * Added existence check first
This commit is contained in:
committed by
Amish Shah
parent
e47f3dda94
commit
f944dce5c7
@@ -193,6 +193,16 @@ class RESTMethods {
|
||||
});
|
||||
}
|
||||
|
||||
getUser(userID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.rest.makeRequest('get', Constants.Endpoints.user(userID), true)
|
||||
.then((data) => {
|
||||
resolve(this.rest.client.actions.UserGet.handle(data).user);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
updateCurrentUser(_data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const user = this.rest.client.user;
|
||||
|
||||
Reference in New Issue
Block a user