Skip to content

Commit

Permalink
fix: bug with pendingGuildsData not storing data properly
Browse files Browse the repository at this point in the history
  • Loading branch information
AwesomeStickz committed Oct 31, 2024
1 parent 1125759 commit 5384221
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ export const createProxyCache = <T extends ProxyCacheTypes = ProxyCacheTypes, B
if (guild) guild.roles.set(role.id, role);
else {
const pendingGuild = pendingGuildsData.get(guildId);
if (!pendingGuild) pendingGuildsData.set(guildId, { roles: new Collection() });
if (!pendingGuild) pendingGuildsData.set(guildId, { channels: new Collection(), members: new Collection(), roles: new Collection() });

pendingGuildsData.get(guildId)?.roles?.set(role.id, role);
pendingGuildsData.get(guildId)?.roles!.set(role.id, role);
}
} else console.warn(`[CACHE] Can't cache role(${role.id}) since guild.roles is enabled but a guild id was not found.`);
}
Expand Down Expand Up @@ -342,9 +342,9 @@ export const createProxyCache = <T extends ProxyCacheTypes = ProxyCacheTypes, B
if (guild) guild.members.set(member.id, member);
else {
const pendingGuild = pendingGuildsData.get(member.guildId);
if (!pendingGuild) pendingGuildsData.set(member.guildId, { members: new Collection() });
if (!pendingGuild) pendingGuildsData.set(member.guildId, { channels: new Collection(), members: new Collection(), roles: new Collection() });

pendingGuildsData.get(member.guildId)?.members?.set(member.id, member);
pendingGuildsData.get(member.guildId)?.members!.set(member.id, member);
}
} else console.warn(`[CACHE] Can't cache member(${member.id}) since guild.members is enabled but a guild id was not found.`);
}
Expand Down Expand Up @@ -425,9 +425,9 @@ export const createProxyCache = <T extends ProxyCacheTypes = ProxyCacheTypes, B
if (guild) guild.channels.set(channel.id, channel);
else {
const pendingGuild = pendingGuildsData.get(guildId);
if (!pendingGuild) pendingGuildsData.set(guildId, { channels: new Collection() });
if (!pendingGuild) pendingGuildsData.set(guildId, { channels: new Collection(), members: new Collection(), roles: new Collection() });

pendingGuildsData.get(guildId)?.channels?.set(channel.id, channel);
pendingGuildsData.get(guildId)?.channels!.set(channel.id, channel);
}
} else console.warn(`[CACHE] Can't cache channel(${channel.id}) since guild.channels is enabled but a guild id was not found.`);
} else bot.cache.channels.memory.set(channel.id, channel);
Expand Down

0 comments on commit 5384221

Please sign in to comment.