mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Merge branch 'master' of https://github.com/hydrabolt/discord.js
This commit is contained in:
@@ -8,8 +8,8 @@ class GuildMemberRemoveAction extends Action {
|
|||||||
let member = null;
|
let member = null;
|
||||||
if (guild) {
|
if (guild) {
|
||||||
member = guild.members.get(data.user.id);
|
member = guild.members.get(data.user.id);
|
||||||
|
guild.memberCount--;
|
||||||
if (member) {
|
if (member) {
|
||||||
guild.memberCount--;
|
|
||||||
guild.members.remove(member.id);
|
guild.members.remove(member.id);
|
||||||
if (client.status === Status.READY) client.emit(Events.GUILD_MEMBER_REMOVE, member);
|
if (client.status === Status.READY) client.emit(Events.GUILD_MEMBER_REMOVE, member);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -445,18 +445,21 @@ class GuildChannel extends Channel {
|
|||||||
* @param {string} [options.reason] Reason for cloning this channel
|
* @param {string} [options.reason] Reason for cloning this channel
|
||||||
* @returns {Promise<GuildChannel>}
|
* @returns {Promise<GuildChannel>}
|
||||||
*/
|
*/
|
||||||
clone({ name = this.name, withPermissions = true, withTopic = true, nsfw, parent, bitrate, userLimit, reason } = {}) {
|
clone(options = {}) {
|
||||||
const options = {
|
if (typeof options.withPermissions === 'undefined') options.withPermissions = true;
|
||||||
overwrites: withPermissions ? this.permissionOverwrites : [],
|
Util.mergeDefault({
|
||||||
nsfw: typeof nsfw === 'undefined' ? this.nsfw : nsfw,
|
name: this.name,
|
||||||
parent: parent || this.parent,
|
overwrites: options.withPermissions ? this.permissionOverwrites : [],
|
||||||
bitrate: bitrate || this.bitrate,
|
withTopic: true,
|
||||||
userLimit: userLimit || this.userLimit,
|
nsfw: this.nsfw,
|
||||||
reason,
|
parent: this.parent,
|
||||||
type: this.type,
|
bitrate: this.bitrate,
|
||||||
};
|
userLimit: this.userLimit,
|
||||||
return this.guild.channels.create(name, options)
|
reason: null,
|
||||||
.then(channel => withTopic ? channel.setTopic(this.topic) : channel);
|
}, options);
|
||||||
|
options.type = this.type;
|
||||||
|
return this.guild.channels.create(options.name, options)
|
||||||
|
.then(channel => options.withTopic ? channel.setTopic(this.topic) : channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -526,12 +526,7 @@ class GuildMember extends Base {
|
|||||||
*/
|
*/
|
||||||
kick(reason) {
|
kick(reason) {
|
||||||
return this.client.api.guilds(this.guild.id).members(this.user.id).delete({ reason })
|
return this.client.api.guilds(this.guild.id).members(this.user.id).delete({ reason })
|
||||||
.then(() =>
|
.then(() => this);
|
||||||
this.client.actions.GuildMemberRemove.handle({
|
|
||||||
guild_id: this.guild.id,
|
|
||||||
user: this.user,
|
|
||||||
}).member
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user