From 0b5eeb08f3e58fbf79c1a25eed5041dca511aaac Mon Sep 17 00:00:00 2001 From: Funnbot Date: Fri, 3 Feb 2017 18:37:32 -0800 Subject: [PATCH] clone topic in channel.clone() (#1157) * Update GuildChannel.js * Update GuildChannel.js * Update GuildChannel.js * Update GuildChannel.js * Update GuildChannel.js * Update GuildChannel.js --- src/structures/GuildChannel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 7b26adf58..ba8825719 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -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} */ - 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); } /**