I think I got ChannelUpdate working??

This commit is contained in:
hydrabolt
2016-04-30 18:22:09 +01:00
parent 2341c83638
commit 90cf787759
9 changed files with 130 additions and 12 deletions

View File

@@ -96,6 +96,21 @@ class RESTMethods{
.catch(reject);
});
}
UpdateChannel(channel, data) {
return new Promise((resolve, reject) => {
data.name = (data.name || channel.name).trim();
data.topic = data.topic || channel.topic;
data.position = data.position || channel.position;
data.bitrate = data.bitrate || channel.bitrate;
this.rest.makeRequest('patch', Constants.Endpoints.CHANNEL(channel.id), true, data)
.then(data => {
resolve(this.rest.client.actions.ChannelUpdate.handle(data).updated);
})
.catch(reject);
});
}
}
module.exports = RESTMethods;