Schmaltz Posted October 25, 2017 Report Posted October 25, 2017 (edited) This is driving me crazy, basically when my bot crates a trade that doesn't contain any of the bots items (aka only requesting items from the end user) it fails to trigger sentOfferChanged state #2, but when the trade contains any of the bots items it will trigger state #2. I want state 2 so I can send a quick link to the trade, and it works fine aslong as the trade has any of the bots items within it. Also is it sending the items fine, I see the trade offer if I look on steam for it, but simply do not get the #2 state within the bot. Here is an example:https://i.imgur.com/IRyhbzj.png Whats happening here is:- !takecards is requesting 10 cards from the bot, as you see it gets state 2 (and sends a link to the trade <like so)- I decline- !givecards makes the bot request 10 cards from me, as you see it fails to trigger state 2, but it did send the trade if I look at steam- I decline, and as seen from the oldState is says 2, but bot never trigger the #2 state.. what could I be missing? manager.on("sentOfferChanged", (offer, oldState) => { log("sentOfferChanged - ID: #"+offer.id+", state: "+offer.state+", oldState: "+oldState); if (offer.state == 2) { log("Trade sent.."); sendMessage(offer.partner, msg.TradeOfferSent.replace("{url}", "https://steamcommunity.com/tradeoffer/"+offer.id)); } else if (offer.state == 3) { log("Trade finished.."); sendMessage(offer.partner, msg.TradeOfferThanks); playStatus(); } else if (offer.state == 7) { log("Trade declined.."); } }); For kicks I also tried using the equivalent with confirmationAccepted to see if that triggers state #2 but it results in the same behavior, just doesn't make sense to me that it will only trigger state 2 when and only when bot's items are in the trade. :/ edit; after brainstorming for a bit, I suspect since its not offering items perhaps its immediately state 2 by default thus no sentOfferChanged since nothing "changed"?, perhaps I need some fancy callback within offer.send()? Edited October 25, 2017 by Schmaltz Quote
Dr. McKay Posted October 25, 2017 Report Posted October 25, 2017 edit; after brainstorming for a bit, I suspect since its not offering items perhaps its immediately state 2 by default thus no sentOfferChanged since nothing "changed"?, perhaps I need some fancy callback within offer.send()? This is exactly the reason. Quote
Schmaltz Posted October 25, 2017 Author Report Posted October 25, 2017 Nail'd it^ Just got it working as intended by adding getOffer() in the callback <3 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.