Move Log
I'm trying to create a move log like this:
but if the admin moved someone else to the same channel it's gonna just edit the
users
value without creating a new log so it won't log.16 Replies
- 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!because I'm using
LogMove.createdTimestamp < 3000
to check if the user was moved or he joined the channel by himself, is there another way to check that?LogMove.createdTimestamp < 3000 will always be false
createdTimestamp represents the unix milliseconds starting from 1970
it's actually not always, it'll be true when the admin moved user to channel he didn't in last 10 mins
so how to check if the user moved or he joined the channel by himself?
no, it wont
another way instead of
LogMove.createdTimestamp < 3000
you would have to substract LogMove.createdTimestamp from a new date and check if that is < 3000
yes I forgot to type the new date here
but I did in my code
but this way isn't good actually
so I'm asking if anyone can help me with another way to detect if he moved to channel or not?
use the voiceStateUpdate event and check oldState.channel vs newState.channel
but still won't be accurate right?
why not
that will show you when someone switched channels instantly
yes I did it here
but the thing is to detect if the user was moved or he joined the channel by himself
you can get just the executor from the logs without the target
And how do you make sure the user was actually moved?
no I said that cuz I can't make sure that the user got moved or not through logs if u only can get the executor and the channel from the logs
it won't be accurate
yes
that's my point
with an accurate way
Like Qjuh told you, check the users value of the entry
so u r saying that I can get the target that got moved from the logs?
okay I’ll try this tomorrow then I’ll come back here