node-steam-tradeoffer-manager icon indicating copy to clipboard operation
node-steam-tradeoffer-manager copied to clipboard

[Suggestion] Improve 'offloader.js' example

Open Gesh4o opened this issue 5 years ago • 2 comments

Hello doc,

First of all - I am really grateful for having all of your libraries up there - you save all of us a lot of time energy and head bashing - so thank you!

I am new to the steam api ecosystem and I am trying to work with all the perks and quirks of it. I used your demo code in offloader.js (https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/blob/master/examples/offloader.js) to build my very first steam bot and sometimes I was not able to login as my console was prompted for a steam guard code when it was already given in the loginOptions. After little research I found out that it is connected to: https://github.com/DoctorMcKay/node-steam-user/issues/189.

Could we add something like this in the example: `steamUser.on("steamGuard", function(domain, callback, lastCodeWrong) {

console.log("Steam Guard code needed from mobile (main bot)");

if(lastCodeWrong) {
    console.log("Last code wrong, try again!");
    setTimeout(function() {
        console.log(SteamTotp.getAuthCode("shared_secret"));                      
        callback(SteamTotp.getAuthCode("shared_secret"));
    }, 30000);
}

}); `

This is a solution provided from the issue above. What do you think about my suggestion? I can make a pull request if you want.

Gesh4o avatar Feb 24 '19 15:02 Gesh4o

Closing because of lack of response.

Gesh4o avatar Apr 09 '19 16:04 Gesh4o

I don't think this needs to be closed. I haven't responded because this has been fairly low on my priority list, not because I don't think it's a good idea.

DoctorMcKay avatar Apr 09 '19 19:04 DoctorMcKay