Add setting channel overwrites

This commit is contained in:
Amish Shah
2016-08-22 18:47:21 +01:00
parent 00505d099a
commit 6f2caffd32
4 changed files with 87 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ class ClientDataResolver {
if (user instanceof User) {
return user;
} else if ($string(user)) {
return this.client.users.get(user.id);
return this.client.users.get(user);
} else if (user instanceof Message) {
return user.author;
} else if (user instanceof Guild) {

View File

@@ -284,6 +284,14 @@ class RESTMethods {
});
}
setChannelOverwrite(channel, payload) {
return new Promise((resolve, reject) => {
this.rest.makeRequest('put', `${Constants.Endpoints.channelPermissions(channel.id)}/${payload.id}`, true, payload)
.then(resolve)
.catch(reject);
});
}
updateGuildRole(role, _data) {
return new Promise((resolve, reject) => {
/*