Loris 🐐
Loris 🐐
DIAdiscord.js - Imagine an app
Created by Loris 🐐 on 6/12/2024 in #djs-questions
Unable to fetch all members from role
My new code, for other people:
const guildRole = (interaction.guild as Guild).roles.cache.get(teamRoleId);

if (guildRole) {
await guildRole.guild.members.fetch()
console.log(guildRole.members.size) // returns number of members who have the role
}
const guildRole = (interaction.guild as Guild).roles.cache.get(teamRoleId);

if (guildRole) {
await guildRole.guild.members.fetch()
console.log(guildRole.members.size) // returns number of members who have the role
}
7 replies
DIAdiscord.js - Imagine an app
Created by Loris 🐐 on 6/12/2024 in #djs-questions
Unable to fetch all members from role
Okayy ty, it works !
7 replies
DIAdiscord.js - Imagine an app
Created by Loris 🐐 on 6/12/2024 in #djs-questions
Unable to fetch all members from role
Here is my code:
const guildRole = await (interaction.guild as Guild).roles.fetch(teamRoleId, { force: true });
console.log(guildRole?.members)
const guildRole = await (interaction.guild as Guild).roles.fetch(teamRoleId, { force: true });
console.log(guildRole?.members)
7 replies
DIAdiscord.js - Imagine an app
Created by Loris 🐐 on 6/22/2023 in #djs-questions
Exit the Client Ready event
Okay, thank you !
8 replies
DIAdiscord.js - Imagine an app
Created by Loris 🐐 on 6/22/2023 in #djs-questions
Exit the Client Ready event
Several tasks to get content from sqlite and a message sent with client.channels.cache.get(<id>).send("test")
8 replies
DIAdiscord.js - Imagine an app
Created by Loris 🐐 on 6/22/2023 in #djs-questions
Exit the Client Ready event
Hmm, using process.exit() cancels the actions in my case
8 replies