mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Merge remote-tracking branch 'origin/indev' into indev-voice
This commit is contained in:
@@ -679,6 +679,7 @@ class Guild {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_addMember(guildUser, emitEvent = true) {
|
_addMember(guildUser, emitEvent = true) {
|
||||||
|
const existing = this.members.has(guildUser.user.id);
|
||||||
if (!(guildUser.user instanceof User)) guildUser.user = this.client.dataManager.newUser(guildUser.user);
|
if (!(guildUser.user instanceof User)) guildUser.user = this.client.dataManager.newUser(guildUser.user);
|
||||||
|
|
||||||
guildUser.joined_at = guildUser.joined_at || 0;
|
guildUser.joined_at = guildUser.joined_at || 0;
|
||||||
@@ -702,7 +703,7 @@ class Guild {
|
|||||||
* @param {Guild} guild The guild that the user has joined
|
* @param {Guild} guild The guild that the user has joined
|
||||||
* @param {GuildMember} member The member that has joined
|
* @param {GuildMember} member The member that has joined
|
||||||
*/
|
*/
|
||||||
if (this.client.ws.status === Constants.Status.READY && emitEvent) {
|
if (this.client.ws.status === Constants.Status.READY && emitEvent && !existing) {
|
||||||
this.client.emit(Constants.Events.GUILD_MEMBER_ADD, this, member);
|
this.client.emit(Constants.Events.GUILD_MEMBER_ADD, this, member);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,8 +144,8 @@ class GuildChannel extends Channel {
|
|||||||
const prevOverwrite = this.permissionOverwrites.get(userOrRole.id);
|
const prevOverwrite = this.permissionOverwrites.get(userOrRole.id);
|
||||||
|
|
||||||
if (prevOverwrite) {
|
if (prevOverwrite) {
|
||||||
payload.allow = prevOverwrite.allow;
|
payload.allow = prevOverwrite.allowData;
|
||||||
payload.deny = prevOverwrite.deny;
|
payload.deny = prevOverwrite.denyData;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const perm in options) {
|
for (const perm in options) {
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ client.on('userUpdate', (o, n) => {
|
|||||||
console.log(o.username, n.username);
|
console.log(o.username, n.username);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
client.on('guildMemberAdd', (g, m) => console.log(`${m.user.username} joined ${g.name}`));
|
||||||
|
|
||||||
client.on('channelCreate', channel => {
|
client.on('channelCreate', channel => {
|
||||||
console.log(`made ${channel.name}`);
|
console.log(`made ${channel.name}`);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user