SpiTik Posted November 21, 2018 Report Posted November 21, 2018 Can you help me i dont know how to create this function with command !all take all partner cupons to offer. 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}.`); } }); } } ); } }); Quote
SpiTik Posted November 21, 2018 Author Report Posted November 21, 2018 (edited) 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 November 21, 2018 by SpiTik 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.