Issue with sharding after 4 shards

const array = await client.shard.broadcastEval(async (c, { userId, apprentice, adept, expert, master, legendary, patron }) => {
let donor = '\❌'
let membership = 'None'
const server = c.guilds.cache.get('992937347094155356')
if (server) {
let member;
try {
member = await server.members.fetch(`${userId}`)
} catch (error) {
member = undefined
}
if (
member !== undefined &&
(
member.roles.cache.has(apprentice) ||
member.roles.cache.has(adept) ||
member.roles.cache.has(expert) ||
member.roles.cache.has(master) ||
member.roles.cache.has(legendary)
)
) {
donor = '\✅'
if (member.roles.cache.has(apprentice)) {
membership = 'Apprentice'
}
if (member.roles.cache.has(adept)) {
membership = 'Adept'
}
if (member.roles.cache.has(expert)) {
membership = 'Expert'
}
if (member.roles.cache.has(master)) {
membership = 'Master'
}
if (member.roles.cache.has(legendary)) {
membership = 'Legendary'
}
}
await server.members.fetch()
return { donor, membership };
}
return { donor, membership };
}, {
context: {
userId: interaction.user.id,
apprentice: config.premium_apprentice_role,
adept: config.premium_adept_role,
expert: config.premium_expert_role,
master: config.premium_master_role,
legendary: config.premium_legendary_role,
patron: config.patron_role
}
})
const array = await client.shard.broadcastEval(async (c, { userId, apprentice, adept, expert, master, legendary, patron }) => {
let donor = '\❌'
let membership = 'None'
const server = c.guilds.cache.get('992937347094155356')
if (server) {
let member;
try {
member = await server.members.fetch(`${userId}`)
} catch (error) {
member = undefined
}
if (
member !== undefined &&
(
member.roles.cache.has(apprentice) ||
member.roles.cache.has(adept) ||
member.roles.cache.has(expert) ||
member.roles.cache.has(master) ||
member.roles.cache.has(legendary)
)
) {
donor = '\✅'
if (member.roles.cache.has(apprentice)) {
membership = 'Apprentice'
}
if (member.roles.cache.has(adept)) {
membership = 'Adept'
}
if (member.roles.cache.has(expert)) {
membership = 'Expert'
}
if (member.roles.cache.has(master)) {
membership = 'Master'
}
if (member.roles.cache.has(legendary)) {
membership = 'Legendary'
}
}
await server.members.fetch()
return { donor, membership };
}
return { donor, membership };
}, {
context: {
userId: interaction.user.id,
apprentice: config.premium_apprentice_role,
adept: config.premium_adept_role,
expert: config.premium_expert_role,
master: config.premium_master_role,
legendary: config.premium_legendary_role,
patron: config.patron_role
}
})
While having 3 shards, it worked completely as expected. Now that there's 4 shards, it always returns the ❌ and 'None' even when it shouldn't?
1 Reply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server