I am currently creating a TF2 trading bot and I want it to be able to send trade offers but i keep getting this error
C:\Users\Valkyrie\Desktop\Trading Bot\node_modules\steamcommunity\components\users.js:491
callback(null, inventory, currency, body.total_inventory_count);
My main code is
client.on("friendMessage", function(steamID, message) {
if (message == "!buy test item") {
client.chatMessage(steamID, "Setting up the trade offer for Test Item");
console.log("Someone typed in the command '!buy test item'");
const offer = manager.createOffer(steamID);
manager.loadInventory(440, 2, true, (err, inventory) => {
if (err) {
client.chatMessage("There was an error loading the inventory. Please try again. If the problem continues please message the owner by typing '!help'");
console.log(err);
console.log("There was an error loading my inventory.");
} else {
offer.getPartnerInventoryContents(440, 2, true, (err, inventory) => {
if (err) {
client.chatMessage("There was an error loading the inventory. Please try again. If the problem continues please message the owner by typing '!help'");
console.log(err);
console.log("There was an error loading their inventory.");
} else {
const offer = manager.createOffer(76561198083465811);
inventory.forEach(function(item) {
if (item.assetid === '30362') {
offer.addMyItem(item);
offer.addTheirItems(5002, 5002, 5001, 5001, 5000, 5000);
offer.setMessage("1 Law for 2.88 Refined");
offer.send(function(err, status) {
if (err) {
client.chatMessage("There was an error sending the trade offer. Please try again. If the problem continues please message the owner by typing '!help'");
console.log(err);
console.log("There was an error sending the trade offer.");
} else {
console.log(status);
console.log("The trade was sent successfully!");
}
})
}
})
}
})
}
})
}
})