How to automatically set status?

As in, when I first setup discord.js, it would make my bots status "online", when the code was running, and "offline" when it wasn't. How can I return to that behavior?

(I used client.user.setStatus(PresenceUpdateStatus.Online); once, and it never went offline again).
Was this page helpful?