I want it to count for each user on voice channel the time he is on it and send it to a db.
After looking through the docs for a while, I do not see a way to see how long they have been in a channel. My solution for this would be to store the time that they join the channel, and then subtract that from the time they leave. How to do it?
Would like to continue my code, I am using mongo db.
client.on('voiceStateUpdate', (oldState, newState) => {
let newUserChannel = newMember.voiceChannel;
let oldUserChannel = oldMember.voiceChannel;
...
});