Jump to content


Photo
Question

Adding items to Trade

node.js node-steam-tradeoffer-manager

  • Please log in to reply
No replies to this topic

#1 CatZap

CatZap

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 24 August 2018 - 11:35 AM

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?







Also tagged with one or more of these keywords: Question, node.js, node-steam-tradeoffer-manager

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users