Added guild.createChannel(name, type)

This commit is contained in:
hydrabolt
2016-04-26 17:44:42 +01:00
parent e9d7dfaee3
commit 2d3116d505
6 changed files with 52 additions and 5 deletions

View File

@@ -72,6 +72,19 @@ class RESTMethods{
.catch(reject);
});
}
CreateChannel(guild, channelName, channelType) {
return new Promise((resolve, reject) => {
this.rest.makeRequest('post', Constants.Endpoints.GUILD_CHANNELS(guild.id), true, {
name: channelName,
type: channelType,
})
.then(data => {
resolve(this.rest.client.actions.ChannelCreate.handle(data).channel);
})
.catch(reject);
});
}
}
module.exports = RESTMethods;