voice channel

Why when i fetch a voice channel, and use the voiceChannel.members property, it works fine, but it does not refresh, like when someone leave, enter the voice channel, it do nothing, am making an API that is also combined with the discord bot for controll, this is the handler function: exports.getAllMembersInRoom = catchAsync(async (req, res, next) => { if (!req.params?.id) return next(new AppError('Please provice channel id', 400)); // Get the voice channel object for the voice room you want to list the members of. const voiceChannel = await client.channels.fetch(req.params.id); if (!voiceChannel) return next(new AppError(Invalid channel ID, 400)); if (!voiceChannel.isVoiceBased()) return next(new AppError(Please provide a voice channel ID, 400)); // Get the members of the voice channel. const members = voiceChannel.members; // Returning the members to the client res.status(200).json({ status: 'success', data: { members, }, }); });
3 Replies
d.js toolkit
d.js toolkit16mo 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!
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
C⁶H¹²O⁶
C⁶H¹²O⁶OP16mo ago
I will try Thank you that actually worked
Want results from more Discord servers?
Add your server