mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor(Managers): rename add to _add (#6060)
This commit is contained in:
@@ -42,7 +42,7 @@ class GuildChannelManager extends CachedManager {
|
||||
* @name GuildChannelManager#cache
|
||||
*/
|
||||
|
||||
add(channel) {
|
||||
_add(channel) {
|
||||
const existing = this.cache.get(channel.id);
|
||||
if (existing) return existing;
|
||||
this.cache.set(channel.id, channel);
|
||||
@@ -169,12 +169,12 @@ class GuildChannelManager extends CachedManager {
|
||||
const data = await this.client.api.channels(id).get();
|
||||
// Since this is the guild manager, throw if on a different guild
|
||||
if (this.guild.id !== data.guild_id) throw new Error('GUILD_CHANNEL_UNOWNED');
|
||||
return this.client.channels.add(data, this.guild, cache);
|
||||
return this.client.channels._add(data, this.guild, cache);
|
||||
}
|
||||
|
||||
const data = await this.client.api.guilds(this.guild.id).channels.get();
|
||||
const channels = new Collection();
|
||||
for (const channel of data) channels.set(channel.id, this.client.channels.add(channel, this.guild, cache));
|
||||
for (const channel of data) channels.set(channel.id, this.client.channels._add(channel, this.guild, cache));
|
||||
return channels;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user