add GuildChannel#clone (#973)

* add GuildChannel#clone

* e
This commit is contained in:
Gus Caplan
2016-12-11 03:07:52 -06:00
committed by Amish Shah
parent 710d3db94f
commit d766e727a1
4 changed files with 27 additions and 10 deletions

View File

@@ -128,10 +128,12 @@ class RESTMethods {
}).then(data => this.rest.client.actions.MessageUpdate.handle(data).updated);
}
createChannel(guild, channelName, channelType) {
createChannel(guild, channelName, channelType, overwrites) {
if (overwrites instanceof Collection) overwrites = overwrites.array();
return this.rest.makeRequest('post', Constants.Endpoints.guildChannels(guild.id), true, {
name: channelName,
type: channelType,
permission_overwrites: overwrites,
}).then(data => this.rest.client.actions.ChannelCreate.handle(data).channel);
}