mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 07:02:00 +00:00
Webpack build for branch master: 986e6da196
This commit is contained in:
parent
6936b5b0b4
commit
ed6a02394e
2 changed files with 16 additions and 13 deletions
|
|
@ -3863,18 +3863,21 @@ class GuildChannel extends Channel {
|
|||
* @param {string} [options.reason] Reason for cloning this channel
|
||||
* @returns {Promise<GuildChannel>}
|
||||
*/
|
||||
clone({ name = this.name, withPermissions = true, withTopic = true, nsfw, parent, bitrate, userLimit, reason } = {}) {
|
||||
const options = {
|
||||
overwrites: withPermissions ? this.permissionOverwrites : [],
|
||||
nsfw: typeof nsfw === 'undefined' ? this.nsfw : nsfw,
|
||||
parent: parent || this.parent,
|
||||
bitrate: bitrate || this.bitrate,
|
||||
userLimit: userLimit || this.userLimit,
|
||||
reason,
|
||||
type: this.type,
|
||||
};
|
||||
return this.guild.channels.create(name, options)
|
||||
.then(channel => withTopic ? channel.setTopic(this.topic) : channel);
|
||||
clone(options = {}) {
|
||||
if (typeof options.withPermissions === 'undefined') options.withPermissions = true;
|
||||
Util.mergeDefault({
|
||||
name: this.name,
|
||||
overwrites: options.withPermissions ? this.permissionOverwrites : [],
|
||||
withTopic: true,
|
||||
nsfw: this.nsfw,
|
||||
parent: this.parent,
|
||||
bitrate: this.bitrate,
|
||||
userLimit: this.userLimit,
|
||||
reason: null,
|
||||
}, options);
|
||||
options.type = this.type;
|
||||
return this.guild.channels.create(options.name, options)
|
||||
.then(channel => options.withTopic ? channel.setTopic(this.topic) : channel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue