Jump to content
McKay Development

Recommended Posts

Posted

Recently I have been encountereing a issue with my session expireing on one of my bots, and I'm unsure what a correct way of refreshing the session would be, as I have never touched upon this.

 

A function for logging back in, that I figured would work was;

community.on('sessionExpired', function (err) {
    console.log('Session expired.');
    if (err) {
        if (err.message == "Not Logged In") {
            client.logOn(logOnOptions);
			return;
        } else {
            console.log(err.message);
			return;
        }
    } else {
        client.logOn(logOnOptions);
		return;
    }
});

But sadly it does not log the user back in.

 

Would a possible solution be making the client log out first when the session is expiering and then logging back in?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...