mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
add way more friend shit (#815)
This commit is contained in:
committed by
Schuyler Cebulskie
parent
9f7c630796
commit
422b90c711
@@ -658,6 +658,24 @@ class RESTMethods {
|
||||
}).catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
blockUser(user) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.rest.makeRequest('put', `${Constants.Endpoints.relationships('@me')}/${user.id}`, true, { type: 2 })
|
||||
.then(() => {
|
||||
resolve(user);
|
||||
}).catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
unblockUser(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;
|
||||
|
||||
Reference in New Issue
Block a user