fix(GuildChannel): spread clone options to avoid infinite recursion (#5800)

This commit is contained in:
SpaceEEC
2021-06-10 18:07:12 +02:00
committed by GitHub
parent 18ac72e457
commit 2f5424bdac

View File

@@ -573,23 +573,20 @@ class GuildChannel extends Channel {
* @returns {Promise<GuildChannel>} * @returns {Promise<GuildChannel>}
*/ */
clone(options = {}) { clone(options = {}) {
Util.mergeDefault( return this.guild.channels.create(options.name, {
{ name: this.name,
name: this.name, permissionOverwrites: this.permissionOverwrites,
permissionOverwrites: this.permissionOverwrites, topic: this.topic,
topic: this.topic, type: this.type,
type: this.type, nsfw: this.nsfw,
nsfw: this.nsfw, parent: this.parent,
parent: this.parent, bitrate: this.bitrate,
bitrate: this.bitrate, userLimit: this.userLimit,
userLimit: this.userLimit, rateLimitPerUser: this.rateLimitPerUser,
rateLimitPerUser: this.rateLimitPerUser, position: this.position,
position: this.position, reason: null,
reason: null, ...options,
}, });
options,
);
return this.guild.channels.create(options.name, options);
} }
/* eslint-enable max-len */ /* eslint-enable max-len */