oldMember and newMember timeout issue

const oldTimeout = oldMember.communicationDisabledUntilTimestamp
const newTimeout = newMember.communicationDisabledUntilTimestamp
console.log("oldTimeout:", oldTimeout)
console.log("newTimeout:", newTimeout)

// timeout added
if (!oldTimeout && newTimeout) {...}
why isn't
oldTimeout
null when the
oldMember
wasn't timed out previously?
I'm trying to make timeout logs but sometimes the
oldTimeout
isn't null but the
oldMember
wan't on timeout
I see that if I don't manually remove the timeout (i.e. timeout is removed automatically by discord), the oldTimeout is available, what should I do to properly check the timeout is added to a member?
Was this page helpful?