acceptAndParseOffer
See original GitHub issueHi, your acceptAndParseOffer don’t work with trades over 40 items (I test on dota 2) please fix it this is my code:
function acceptAndParseOffer(offer, botID) {
console.log(offer.id);
offer.getReceivedItems(function (err, items) {
if (!err) {
offer.accept(true, function (err, status) {
if (!err) {
var itemsPrice = [];
items.forEach(function (item, itemNum) {
var itemInfo = {
name: item.name,
market_hash_name: item.market_hash_name,
classid: item.classid,
botID: botID
};
parsePrice(item.market_hash_name, function (price) {
console.log(price);
itemInfo.price = price;
redisClient.rpush('inventory_' + offer.partner.getSteamID64(), JSON.stringify(itemInfo));
});
});
console.tag('Deposits').info('Оффер #' + offer.id + ' успешно принят!');
io.sockets.emit('newItemsToInv', offer.partner.getSteamID64());
}
});
} else {
console.tag('Deposits').error(err,items);
setTimeout(function () {
acceptAndParseOffer(offer, botID)
}, 1000);
}
});
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You haven’t received items if you haven’t accepted the trade.
How can you “get received items” before you accept the offer? You haven’t received anything yet.