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

Getting error when sentOfferChanged event emits

Open Chervychnyk opened this issue 6 years ago • 9 comments

When sentOfferChanged event emits I'm getting this type of error: ''error: Error: No API-Key set (yet)", that's why I can't get new state of the tradeoffer. I am using callback similar to one provided in examples. Can you help me to solve this problem?

Chervychnyk avatar Jul 26 '17 07:07 Chervychnyk

The bot account you are using does not have an API key. Try to login to account at http://steamcommunity.com/dev/apikey if you are unable to generate an API key it means u need to spend $5 USD to enable API key. Try it, and update me on what happens.

SamerAlsayegh avatar Jul 26 '17 12:07 SamerAlsayegh

I've already added API key for main account in config, but I am running 3 bots through BotsManager. How can I set up keys for all of them?

Chervychnyk avatar Jul 26 '17 13:07 Chervychnyk

Oh, you will need to access that page for every account. In a future update I will add a way to automatically register for API key for accounts. I will place this Issue as a WIP for now, and update it when I add the feature.

SamerAlsayegh avatar Jul 26 '17 13:07 SamerAlsayegh

In the debug.log, what message do you get when you login? Is it something like the following: Failed to get API Key - TradeOverflowChecking disabled for "ACCOUNT NAME" & getOffers call disabled

If it is.. That would usually mean that the account is a limited account (https://support.steampowered.com/kb_article.php?ref=3330-IAGK-7663)

If you are logging in and out a lot, that error could also show up.

If you think the account is not limited, tell me... I will try to add further error logging for that section so we can pinpoint the issue.

SamerAlsayegh avatar Jul 26 '17 21:07 SamerAlsayegh

In debug.log I get actually this line after account is logged in.

From link that you've provided, I think that one of my accounts is limited because we never purchased anything from it. Sorry for bothering you and thanks for your reply.

Chervychnyk avatar Jul 27 '17 07:07 Chervychnyk

After I added 5$ to my Steam wallet, it become even worse. I have the same problem and getting messages you mentioned, but errors appears periodically (after bot login). When they log in for the first time, my log is clear from error messages, but after relogin I see this "Failed to get API Key - TradeOverflowChecking disabled for "ACCOUNT NAME" & getOffers call disabled" from several bots, that was activated a long time ago. And this problem can be solved by relogin.

Chervychnyk avatar Aug 01 '17 13:08 Chervychnyk

Uhh. Ok stop thr bots for a few minutes. You may have been ratelimited by Steam. Which is why bots the worked before are now not working. I'd say 30 minutes should be enough for the rate limit to stop.

Check and tell me what happens.

SamerAlsayegh avatar Aug 01 '17 23:08 SamerAlsayegh

Yeah, I think they were rate limited and that caused an errors. How can I detect this state? I found event in source code for botAccount being rateLimited and you are changing a property in bot object. Do you think it will be enough to check from time to time this property and logout bot when he reaches this limit?

Chervychnyk avatar Aug 02 '17 09:08 Chervychnyk

I do not recommend to use it fully, as I have not fully handled this situation. If you wanted to come up with your own, you can copy the handling such as its done here

In that block, I basically add a task to a queue if its detected as ratelimited. Then after a few minutes I process all the tasks that were added to queue because of rate limit.

SamerAlsayegh avatar Aug 02 '17 15:08 SamerAlsayegh