mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
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:
committed by
Schuyler Cebulskie
parent
cee9e4839c
commit
0b5eeb08f3
@@ -250,10 +250,12 @@ class GuildChannel extends Channel {
|
|||||||
* Clone this channel
|
* Clone this channel
|
||||||
* @param {string} [name=this.name] Optional name for the new channel, otherwise it has the name of 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} [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>}
|
* @returns {Promise<GuildChannel>}
|
||||||
*/
|
*/
|
||||||
clone(name = this.name, withPermissions = true) {
|
clone(name = this.name, withPermissions = true, withTopic = true) {
|
||||||
return this.guild.createChannel(name, this.type, withPermissions ? this.permissionOverwrites : []);
|
return this.guild.createChannel(name, this.type, withPermissions ? this.permissionOverwrites : [])
|
||||||
|
.then(channel => withTopic ? channel.setTopic(this.topic) : channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user