Full voice logging

Anyone knows how to make a full voice logging system that logs when an administrator disconnect a user and when a user disconnect by himself. By using audit logs, there is no difference between disconnecting yourself and being disconnected by an admin because only when an admin does it a log is created
4 Replies
d.js toolkit
d.js toolkit6mo 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!
Daniël
DaniëlOP6mo ago
In theory there is a difference, yes, but not in practice. Even if you are going to disconnect yourself, there will be no audit log so even if you are going to retrieve audit logs, it will always retrieve the last audit log and that will then be a member move while the user himself just disconnect But also if you check the timestamp it's broke when you leave
Daniël
DaniëlOP6mo ago
Pastebin
const { AuditLogEvent, EmbedBuilder } = require("discord.js");modul...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Daniël
DaniëlOP6mo ago
yeh that's he problem leaving doesn't casue an AuditLog so if you disconnect a user and then i leave the channel its also creaters this embed userDisconnect.addFields({ name: "Disconnected by:", value: > <@${executor.id}> (${executor.id}) }) Where i need to check the target and why and how But first check if the disconnected user from the AuditLog matches the one of the emitted voiceStateUpdate event or first check the timedifference? You mean like this
if (executor.id !== oldState.member.user.id) {
// user has been disconnect by an admin
if (timeDifference < 5000) {

}
} else {
// user disconnecting self
}
if (executor.id !== oldState.member.user.id) {
// user has been disconnect by an admin
if (timeDifference < 5000) {

}
} else {
// user disconnecting self
}
target is null const { executor, target, extra, createdTimestamp } = entry; console.log(target); That's nothing or i'm looking wrong? the only properties that i got out of the entry and working are the executor and createdtimestamp the executor returns the user (If the user disconnect by himself it's the user self) if the user disconnected by an admin the executor has the id of the admin And even if you go and look, I don't think you'll ever get these logs right at all. Because you can look at the time only as soon as I now (12:26:10) kick someone out of a channel and I do this at 12:26:20 again, then those 5 seconds of the variable time difference are over and they start thinking that it was not an admin who kicked the user out but that the user himself left. what said that extra.count field? And what can that said in this case to make a difference between a user disconenct by self and a member disconnect by an admin
Want results from more Discord servers?
Add your server