We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d77746c commit 75d6686Copy full SHA for 75d6686
commands/Economy/add-money-role.js
@@ -78,8 +78,6 @@ class AddMoneyRole extends Command {
78
return msg.channel.send({ embeds: [errEmbed] });
79
}
80
81
- // Ensure the members cache is populated
82
- await msg.guild.members.fetch();
83
const members = [...role.members.values()];
84
85
amount = BigInt(amount);
commands/Economy/clean-leaderboard.js
@@ -28,7 +28,6 @@ class CleanLeaderboard extends Command {
28
29
const message = await msg.channel.send({ embeds: [em] });
30
31
32
for (const i in users) {
33
if (!msg.guild.members.cache.get(i)) toRemove.push(i);
34
commands/Economy/economy-stats.js
@@ -17,7 +17,6 @@ class EconomyStats extends Command {
17
18
19
async run(msg, _args) {
20
21
const connection = await this.client.db.getConnection();
22
23
const [economyRows] = await connection.execute(
commands/Economy/leaderboard.js
@@ -49,7 +49,6 @@ class Leaderboard extends Command {
49
50
// Fetch data for the current page
51
const offset = (page - 1) * itemsPerPage;
52
53
const usersData = (await db.get(`servers.${msg.guild.id}.users`)) || {};
54
55
const sortedLeaderboard = Object.entries(usersData)
commands/Economy/remove-money-role.js
@@ -68,8 +68,6 @@ class RemoveMoneyRole extends Command {
68
[msg.guild.id],
69
);
70
71
72
73
74
75
amount = BigInt(parseInt(amount));
commands/General/bot-info.js
@@ -17,7 +17,6 @@ class BotInfo extends Command {
async run(msg) {
- await this.client.guilds.cache.forEach((g) => g.available && g.members.fetch());
const botUptime = moment
.duration(this.client.uptime)
.format('y[ years][,] M[ months][,] d[ days][,] h[ hours][,] m[ minutes][ and] s[ seconds]');
commands/Information/perms.js
@@ -20,7 +20,6 @@ class Permissions extends Command {
// If a user is mentioned, fetch them and set them as the infoMemOrRole
if (args?.length > 0) {
24
infoMemOrRole = await this.client.util.getMember(msg, args.join(' '));
25
26
commands/Information/role-info.js
@@ -25,8 +25,6 @@ class RoleInfo extends Command {
const time = then.from(moment());
const ca = then.format('dddd, MMMM Do, YYYY, h:mm a');
27
-
const hexColor = infoRole.hexColor.toString().toUpperCase();
const color = hexColor === '#000000' ? 'None' : hexColor;
const embed = new EmbedBuilder()
@@ -38,7 +36,6 @@ class RoleInfo extends Command {
38
36
{ name: 'ID', value: infoRole.id.toString(), inline: true },
39
37
{ name: 'Mention', value: `\`${infoRole}\``, inline: true },
40
{ name: 'Color', value: color, inline: true },
41
- { name: 'Members', value: infoRole.members.size.toLocaleString(), inline: true },
42
{ name: 'Position', value: `${infoRole.position}/${msg.guild.roles.cache.size}`, inline: true },
43
{ name: 'Mentionable', value: infoRole.mentionable.toString(), inline: true },
44
{ name: 'Managed', value: infoRole.managed.toString(), inline: true },
commands/Information/server-info.js
@@ -32,7 +32,6 @@ class ServerInfo extends Command {
'Invalid Server',
if (!server.available) return this.client.util.errorEmbed(msg, 'That server is currently unavailable');
35
- await server.members.fetch();
// Get the server's creation date and format it
const then = moment(server.createdAt);
events/Bot/clientReady.mjs
@@ -20,6 +20,17 @@ export async function run(client) {
client.games.clear();
client.logger.log(`${client.user.tag}, ready to serve ${client.guilds.cache.size} guilds.`, 'ready');
+ for (const [, guild] of client.guilds.cache) {
+ try {
+ // This fetches all members and stores them in guild.members.cache
+ await guild.members.fetch();
+ } catch (err) {
+ console.error(`❌ Failed to fetch members for ${guild.name}:`, err);
+ }
+
+ await new Promise((resolve) => setTimeout(resolve, 500));
if (BotPanelID?.length > 0 && BotPanelSecret?.length > 0) {
const BotPanelClient = new Client({ id: BotPanelID, secret: BotPanelSecret });
0 commit comments