Skip to content

Commit

Permalink
fix(GuildChannel): spread clone options to avoid infinite recursion (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceEEC committed Jun 10, 2021
1 parent 18ac72e commit 2f5424b
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/structures/GuildChannel.js
Expand Up @@ -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 */

Expand Down

0 comments on commit 2f5424b

Please sign in to comment.