mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
refactor(Managers): rename add to _add (#6060)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user