Jump to content
McKay Development

Bot tradeoffer contains only 1 item


Recommended Posts

I use trade link to send offer to a user not in my friend list. I add their items to the offer using the item id, it successfully adds and sends the offer. But when I see the trade offer it contains only 1 item even if I have sent more than 1. Have a look at the code below (here itemsArray contains the id of items),

it was working fine when I used steamid to create tradeOffer instead of tradeUrl, but that was limited to my friend list only:

 

const offer = manager.createOffer(tradeUrl);

    manager.loadInventory(appid, contextid, true, (err, myInv) => {
        if (err) {
            console.log(err);
        } else {
            manager.loadUserInventory(partnerid, appid, contextid, true, (err, theirInv) => {
                if (err) {
                    console.log(err);
                } else {
                    for(i=0; i<itemsArray.length; i++){
                     
                    const item = theirInv.find((item) => item.assetid ==''+itemsArray[i]);
                    console.log("got item number" + i);
                    offer.addTheirItem(item);    
                    
                    }


                    offer.setMessage(`somerandom message`);
                    offer.send((err, status) => {
                        if (err) {
                            console.log(err);
                        } else {
                            console.log(`Sent offer. Status: ${status}.`);

                        }
                    });
                }
            });
        }
    });

Edited by Gulshan Jangid
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...