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

@@ -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;
}
}