Dyceman Posted March 29, 2018 Report Posted March 29, 2018 (edited) The postGroupAnnouncement doesn't trigger sessionExpired if the session is expired because the err object never displays the "Not Logged In" error. Because of the this issue mentioned above you can't post announcements or log back in from the postGroupAnnoucement. Is there a way around this issue? My code. community.postGroupAnnouncement(config.steam_group_id, title, body, function(err) { console.log(err); // Displays null if the session is expired. if(err != null) { if(err.toString().indexOf("Not Logged In") > -1) // Never is triggered. { console.log("Saved Announcement"); announcements.push({title: title, body: body}); } else { console.log(err); response.status(500).send("An error has occured, check your console."); } } else { console.log("Posted Announcement Successfully!"); response.status(200).send("Posted Announcement Successfully!"); } }); Edited March 29, 2018 by Dyceman Quote
Dyceman Posted March 29, 2018 Author Report Posted March 29, 2018 I created a work around until I get a reply. If anyone else is running into this issue then use the below code. community.getNotifications(function(err, notifications) // Used to check if the user is logged in. { if(err.toString().indexOf("HTTP error 401") > -1) { console.log("Saved Announcement"); announcements.push({title: title, body: body}); client.webLogOn(); } else { community.postGroupAnnouncement(config.steam_group_id, title, body, function(err) // Doesn't check if the user is logged in...... -.- { if(err != null) { console.log(err); response.status(500).send("An error has occured, check your console."); } else { console.log("Posted Announcement Successfully!"); response.status(200).send("Posted Announcement Successfully!"); } }); } }); Quote
Recommended Posts
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.