Eradicate Posted April 19, 2018 Report Share Posted April 19, 2018 Hi, I'm trying to get the assetid after the sentOfferChanged notices an accepted error, the code that I'm currently using logs the old assetid (at least thats what I think) instead of the new one. What seems to be the issue?Should offer.itemsToReceive be changed to something else, as this basically says ToReceive as in still have to get as in these assetids will not be updated?Code: manager.on('sentOfferChanged', function(offer) { var state = offer.state; //check for deposit or witrhdrawl, if withdrawl refund to their inventory. if(state === 3){ console.log('[SteamBot] A sent offer was accepted.'); var items = offer.itemsToReceive, user = offer.partner.getSteamID64(), socket = server.getSocket(user); items.forEach(function(item){ database.query('INSERT INTO `inventories` SET `assetid` = ' + database.pool.escape(item.assetid) + ', `market_hash_name` = ' + database.pool.escape(item.market_hash_name) + ', `user` = ' + database.pool.escape(user) + ', `image` = ' + database.pool.escape(item.icon_url) + ', `status` = 1, `bot` = ' + database.pool.escape(data.id), function(error, call) { if(error){ return; } }); }); server.showAlert(socket, 'success', 'Transaction was successfully completed.'); } }); Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted April 19, 2018 Report Share Posted April 19, 2018 itemsToReceive always contains the pre-trade data. You can use offer.getExchangeDetails to get post-trade data. Quote Link to comment Share on other sites More sharing options...
Eradicate Posted April 19, 2018 Author Report Share Posted April 19, 2018 itemsToReceive always contains the pre-trade data. You can use offer.getExchangeDetails to get post-trade data.Oh, Thanks, do I just replace it? I'll test it out tommorow. Quote Link to comment Share on other sites More sharing options...
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.