mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
fix(GuildChannel): spread clone options to avoid infinite recursion (#5800)
This commit is contained in:
@@ -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 */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user