clone topic in channel.clone() (#1157)

* Update GuildChannel.js

* Update GuildChannel.js

* Update GuildChannel.js

* Update GuildChannel.js

* Update GuildChannel.js

* Update GuildChannel.js
This commit is contained in:
Funnbot
2017-02-03 18:37:32 -08:00
committed by Schuyler Cebulskie
parent cee9e4839c
commit 0b5eeb08f3

View File

@@ -250,10 +250,12 @@ class GuildChannel extends Channel {
* Clone this channel
* @param {string} [name=this.name] Optional name for the new channel, otherwise it has the name of this channel
* @param {boolean} [withPermissions=true] Whether to clone the channel with this channel's permission overwrites
* @param {boolean} [withTopic=true] Whether to clone the channel with this channel's topic
* @returns {Promise<GuildChannel>}
*/
clone(name = this.name, withPermissions = true) {
return this.guild.createChannel(name, this.type, withPermissions ? this.permissionOverwrites : []);
clone(name = this.name, withPermissions = true, withTopic = true) {
return this.guild.createChannel(name, this.type, withPermissions ? this.permissionOverwrites : [])
.then(channel => withTopic ? channel.setTopic(this.topic) : channel);
}
/**