thank you for your reply dr McKay,
so i need to put all my event outside the api?
something like this example :
var options = {
promptSteamGuardCode: false,
singleSentryfile: false,
autoRelogin: true,
dataDirectory: null,
}
var client = new SteamUser(options);
client.on('error', function (err) {
switch (err.eresult) {
case 5:
log('error: invalid password');
case 84:
log('error: rate limit exceeded');
case 6:
log('error: logged in elsewhere');
default:
log('error: ' + err.eresult);
}
stopClient(steamUsername);
});
function stopClient(steamUsername) {
if (typeof activeClient !== 'undefined' && activeClient) {
//await activeBots[steamUsername].logOff(); // logOff is not async function?
activeClient.logOff(); // logout, but if the bot ran into an error its not logged in
delete activeClient; // seems to work, but not if it ran into an error
log('client stopped', steamUsername);
}
}
router.route('/login').get((req, res) => {
client.logOn({
"accountName": config.accountName,
"password": config.password
})
})
router.route('/verifycode').get((req, res) => {
client.on('steamGuard', function(domain, callback) {
console.log("Steam Guard code needed from email ending in " + domain);
// var code = getCodeSomehow();
var code = "DVWQ4";
var callback = callback(code);
res.status(200).json({
success: true,
callback
})
});
})
if i'm wrong again, could you please explained it in more detail? or is there any exact example that i can take a look?
so sorry, because this is still new for me, so its still confusing how it really works.
best regards,
thanks