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
This commit is contained in:
bdistin
2018-01-11 12:44:35 -06:00
committed by Amish Shah
parent 9eac19d9d8
commit 2249da464f
2 changed files with 3 additions and 3 deletions

View File

@@ -411,8 +411,8 @@ class GuildChannel extends Channel {
* @returns {Promise<GuildChannel>}
*/
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);
}

View File

@@ -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);
}
/**