mirror of
https://github.com/danbulant/discord.js
synced 2026-06-15 12:41:24 +00: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:
parent
cee9e4839c
commit
0b5eeb08f3
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue