this isn’t really an error but more of a question

How would you exactly use the presence to detect if a specific role has online members? as i am trying to make a command that pings people on that role if they are online but i don't understand how presence work
DT
d.js toolkit15d ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
N
NyR15d ago
I'd say fetch the guild members first (possibly with withPresences option), Then get the role you want and access it's member via <Role>.members, and filter all member who does not have <Member>.presence property or if <Member>.presence.status is 'offline' There maybe a better way ig, but this is what I'd do Although I'm not sure how you plan to ping the members if you do not want to ping the role, it can be spammy (and possibly API abuse) if you are going to do it separately for each active member
ZHA
ZeDev (Hades Arc)15d ago
in another server i am in with this specific command (i got inspo from it) there is a time limit per use on each command so i'd probably add that into the code to have a time limit for each time the cmmd is used
Want results from more Discord servers?
Add your server
More Posts
duplicate responsesSlash command Duplicate error!!i keep getting this error trying to refresh my slash cmds using the command deploy from discordjs.gucrash even if I have a trycatchThe bot crashes even if I put a trycatch(error).Trouble with collector and interactionsHere's the part of my code that's causing errors: ```javascript async function handleListReactions(unknown interactionhello everyone i have a ticket bot and when the admin want to close the ticket and press the button What are the exact differences between a Webhook and a Webhook client?I've read the page on the [discordjs.guide](https://discordjs.guide/popular-topics/webhooks.html#whaChecking if a user is mobiile```JS client.on('messageCreate', async (message) => { // Check if the user is online and has preSharding QuestionsHello, As my bot is nearly reaching the 2k servers. I need to prepare it to sharding but I have soRepeating interactionIs there a way to use the 'interaction.update' multiple times? So i can make like one button after aWhat Discord.js features have the potential to hit the limit/go over the set Discord API limits?Where can I even find Discord's API limits? I just want to make sure that what I am doing with my boError when i do npm install discord.jsi don’t know how to fix this at all and i’m beyond confused i’ve tried so many times i am useing VisSimple question, how can I check if an incoming message is *specifically* a slash command?How can I check to see if an incoming message (messageCreate) is a slash command? Sometimes a typo cdiscord voice enginehello im just asking if someone got an alternative discord voice engine that work on windowsDeleting Ephemeral MessagesIs there any sort of way to reply to an interaction privately and then delete the reply?