RavenX86 Posted July 11, 2016 Report Posted July 11, 2016 When I send an offer from the bot to the user and the user accepts and confirms with the mobile the bot's account receives the item but no event is launched on bot.Polling Data manually every 2 seconds shows that the offer is shown in pollData in state 2 still. Also no other events seem to work for me (EG: .on("debug",console.log) ). Can I have made a mistake that crashed the events?My code looks something like this console.dir("logged"); var manager = new SteamTrades({ "community": bot.community, // Polling every 30 seconds is fine since we get notifications from Steam //"domain": "example.com", "pollInterval": 5000, "language": "en" // We want English item descriptions }); manager.on('sentOfferChanged',function(offer, oldState) { console.dir("sentOfferChanged"); console.dir(offer); }); manager.on('pollFailure',function(err){ console.log("failed to poll"); console.log(err); }); manager.on('pollData',function(pollData){ console.log("pollData ",pollData); }); manager.on('debug', console.log); live_bots[bot.index].manager = manager; Quote
Dr. McKay Posted July 12, 2016 Report Posted July 12, 2016 I'm not sure I 100% understand. Let me clarify a couple things.SteamTrades is what you get back from require('steam-tradeoffer-manager'), yes? Are you calling manager.setCookies anywhere? What's your console output? Quote
RavenX86 Posted July 12, 2016 Author Report Posted July 12, 2016 1) SteamTrades is actually var SteamTrades = require("steam-tradeoffer-manager"); so just bad naming.2) no, I only create the trade manager object after it's already logged via a Steam Community by passing the community object (I assumed this step also takes the cookies ? )3) For the events none, for pollData I print with an interval is something like{ sent: { '1389220944': 2 } }So Trad is still in state 2 Quote
RavenX86 Posted July 12, 2016 Author Report Posted July 12, 2016 Yeah, nevermind , I'm stupid. Now I manually set the cookies and it works. I don't know why I assumed passing community will automatically take the cookies from it. Anyway Thanks a lot. This can be closed. Quote
Dr. McKay Posted July 12, 2016 Report Posted July 12, 2016 It does take the cookies, but calling manager.setCookies is still important as that's when it grabs the API key. 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.