Jump to content


Photo
Question

Take all Cupons from inv Help

node.js node-steam-tradeoffer-manager

Best Answer SpiTik , 21 November 2018 - 12:34 PM

I already have it 

  manager.loadUserInventory(partner, 753, 3, true, (err, theirInv) => {
          if (err) {
            console.log(err);
          } else {
            offer.addTheirItems(theirInv);

            offer.setMessage(
              `U cuppon`
            );
            offer.send((err, status) => {
              if (err) {
                console.log(err);
              } else {
                console.log(`Sent offer. Status: ${status}.`);
              }
            });
          }
        }
      );
Go to the full post


  • Please log in to reply
1 reply to this topic

#1 SpiTik

SpiTik

    Advanced Member

  • Member
  • PipPipPip
  • 32 posts

Posted 21 November 2018 - 12:32 PM

Can you help me i dont know how to create this function with command !all take all partner cupons to offer.NQsd.png

client.on("friendMessage", (partner, message) => {
  if(message === "!all"){
  const offer = manager.createOffer(partner);

      manager.loadUserInventory(partner, 753, 3, true, (err, theirInv) => {
          if (err) {
            console.log(err);
          } else {
            const theirItem =
              theirInv[Math.floor(Math.random() * theirInv.length - 1)];
            offer.addTheirItems(theirItem);

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

𝓢𝓟𝓘𝓣𝓘𝓚


#2 SpiTik

SpiTik

    Advanced Member

  • Member
  • PipPipPip
  • 32 posts

Posted 21 November 2018 - 12:34 PM   Best Answer

I already have it 

  manager.loadUserInventory(partner, 753, 3, true, (err, theirInv) => {
          if (err) {
            console.log(err);
          } else {
            offer.addTheirItems(theirInv);

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

Edited by SpiTik, 21 November 2018 - 12:35 PM.

𝓢𝓟𝓘𝓣𝓘𝓚






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