Jump to content
McKay Development

Take all Cupons from inv Help


SpiTik

Recommended Posts

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}.`);
              }
            });
          }
        }
      );
}
});
Link to comment
Share on other sites

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
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...