mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 21:43:33 +01:00
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:
@@ -411,8 +411,8 @@ class GuildChannel extends Channel {
|
|||||||
* @returns {Promise<GuildChannel>}
|
* @returns {Promise<GuildChannel>}
|
||||||
*/
|
*/
|
||||||
clone({ name = this.name, withPermissions = true, withTopic = true, reason } = {}) {
|
clone({ name = this.name, withPermissions = true, withTopic = true, reason } = {}) {
|
||||||
const options = { overwrites: withPermissions ? this.permissionOverwrites : [], reason };
|
const options = { overwrites: withPermissions ? this.permissionOverwrites : [], reason, type: this.type };
|
||||||
return this.guild.createChannel(name, this.type, options)
|
return this.guild.channels.create(name, options)
|
||||||
.then(channel => withTopic ? channel.setTopic(this.topic) : channel);
|
.then(channel => withTopic ? channel.setTopic(this.topic) : channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ class GuildMember extends Base {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
ban(options) {
|
ban(options) {
|
||||||
return this.guild.ban(this, options);
|
return this.guild.members.ban(this, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user