From 2249da464fb188a75149ff76727015c307627202 Mon Sep 17 00:00:00 2001 From: bdistin Date: Thu, 11 Jan 2018 12:44:35 -0600 Subject: [PATCH] Fix member.ban() and channel.clone() (#2241) * Fix member.ban() * also fix channel.clone() * type is an option parameter in the new create * lint * better fix for clone --- src/structures/GuildChannel.js | 4 ++-- src/structures/GuildMember.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 518e12253..11cc571e9 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -411,8 +411,8 @@ class GuildChannel extends Channel { * @returns {Promise} */ clone({ name = this.name, withPermissions = true, withTopic = true, reason } = {}) { - const options = { overwrites: withPermissions ? this.permissionOverwrites : [], reason }; - return this.guild.createChannel(name, this.type, options) + const options = { overwrites: withPermissions ? this.permissionOverwrites : [], reason, type: this.type }; + return this.guild.channels.create(name, options) .then(channel => withTopic ? channel.setTopic(this.topic) : channel); } diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index 182f9cb12..80c6ce48c 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -543,7 +543,7 @@ class GuildMember extends Base { * .catch(console.error); */ ban(options) { - return this.guild.ban(this, options); + return this.guild.members.ban(this, options); } /**