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>}
*/
clone(options = {}) {
Util.mergeDefault(
{
name: this.name,
permissionOverwrites: this.permissionOverwrites,
topic: this.topic,
type: this.type,
nsfw: this.nsfw,
parent: this.parent,
bitrate: this.bitrate,
userLimit: this.userLimit,
rateLimitPerUser: this.rateLimitPerUser,
position: this.position,
reason: null,
},
options,
);
return this.guild.channels.create(options.name, options);
return this.guild.channels.create(options.name, {
name: this.name,
permissionOverwrites: this.permissionOverwrites,
topic: this.topic,
type: this.type,
nsfw: this.nsfw,
parent: this.parent,
bitrate: this.bitrate,
userLimit: this.userLimit,
rateLimitPerUser: this.rateLimitPerUser,
position: this.position,
reason: null,
...options,
});
}
/* eslint-enable max-len */