CatZap Posted August 24, 2018 Report Posted August 24, 2018 Hello, i'm newbie in creating bots and i don't know how to make trade sending system properly(It doesn't add items). I provide code below: var incomeMessage = message; var splittedMsg = incomeMessage.split(" "); if(splittedMsg[0] == "!buy") { splittedMsg = incomeMessage.slice(5); client.chatMessage(steamID, "Sellin' item named " + splittedMsg); manager.getUserInventoryContents(steamID, 440, 2, true, (err, inv) => { if (err) { throw err; } else { const offer = manager.createOffer(steamID); let item = inv.filter(item => item.market_name == splittedMsg); let itemsToTrade = item[0]; offer.addMyItem(itemsToTrade); offer.setMessage('You recieved a Refined Metal!'); offer.send((err, status) => { if (err) { console.log(err); } else { console.log('trade sent'); console.log(status); } }); } }); } I send message to bot like !buy Refined Metal and it has to put 1 Refined Metal to trade and then send it to me. But i has error 26. I know it means that i don't have such items in my inventory. So can you help me with that? 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.