refactor(Managers): rename add to _add (#6060)

This commit is contained in:
1Computer1
2021-07-08 06:34:45 -04:00
committed by GitHub
parent 28b5ffb4d6
commit 9cd5e7ed61
72 changed files with 157 additions and 159 deletions

View File

@@ -8,9 +8,9 @@ module.exports = (client, { d: data }) => {
if (data.guild_id) {
const guild = client.guilds.cache.get(data.guild_id);
if (!guild) return;
command = guild.commands.add(data);
command = guild.commands._add(data);
} else {
command = client.application.commands.add(data);
command = client.application.commands._add(data);
}
/**

View File

@@ -8,10 +8,10 @@ module.exports = (client, { d: data }) => {
if (data.guild_id) {
const guild = client.guilds.cache.get(data.guild_id);
if (!guild) return;
command = guild.commands.add(data);
command = guild.commands._add(data);
guild.commands.cache.delete(data.id);
} else {
command = client.application.commands.add(data);
command = client.application.commands._add(data);
client.application.commands.cache.delete(data.id);
}

View File

@@ -10,10 +10,10 @@ module.exports = (client, { d: data }) => {
const guild = client.guilds.cache.get(data.guild_id);
if (!guild) return;
oldCommand = guild.commands.cache.get(data.id)?._clone() ?? null;
newCommand = guild.commands.add(data);
newCommand = guild.commands._add(data);
} else {
oldCommand = client.application.commands.cache.get(data.id)?._clone() ?? null;
newCommand = client.application.commands.add(data);
newCommand = client.application.commands._add(data);
}
/**

View File

@@ -12,7 +12,7 @@ module.exports = (client, { d: data }, shard) => {
} else {
// A new guild
data.shardId = shard.id;
guild = client.guilds.add(data);
guild = client.guilds._add(data);
if (client.ws.status === Status.READY) {
/**
* Emitted whenever the client joins a guild.

View File

@@ -8,9 +8,9 @@ module.exports = (client, { d: data }) => {
if (!guild) return;
const members = new Collection();
for (const member of data.members) members.set(member.user.id, guild.members.add(member));
for (const member of data.members) members.set(member.user.id, guild.members._add(member));
if (data.presences) {
for (const presence of data.presences) guild.presences.add(Object.assign(presence, { guild }));
for (const presence of data.presences) guild.presences._add(Object.assign(presence, { guild }));
}
/**
* Emitted whenever a chunk of guild members is received (all members come from the same guild).

View File

@@ -6,7 +6,7 @@ module.exports = (client, { d: data }, shard) => {
const guild = client.guilds.cache.get(data.guild_id);
if (guild) {
guild.memberCount++;
const member = guild.members.add(data);
const member = guild.members._add(data);
if (shard.status === Status.READY) {
/**
* Emitted whenever a user joins a guild.

View File

@@ -14,7 +14,7 @@ module.exports = (client, { d: data }, shard) => {
for (const guild of data.guilds) {
guild.shardId = shard.id;
client.guilds.add(guild);
client.guilds._add(guild);
}
if (client.application) {