Jump to content
McKay Development

Check Trade accept


sev4a

Recommended Posts


The question above has been solved

How do I make sure that one item is sent to only one user? So that there was no such thing that I sent one item to one, the same one came to the other, and in the end I took only 1

function sendtrade(id) {
	manager.loadInventory(730, 2, true, (err, inventory) => {
		if (err) return console.log(`${err}`);
		if (inventory.length == 0) return console.log("Нечего передавать бро");
		console.log("Found %s steam items",inventory.length);
		
		const offer = manager.createOffer(id);
		offer.addMyItem(inventory[0]);
		offer.setMessage(`Sent By CSGO Bot`);
		offer.send(function(err, status) {

			if (err) return console.log(err);
			if (status == 'pending') {
				console.log(`Трейд #${offer.id} отправлен, но ждет подтверждения`);
				community.acceptConfirmationForObject(config.lolka, offer.id, function(err) {
					if (err) {
						console.log(err);
					} else {
						console.log("Трейд успешно подтвержден");
					}
				});
			} else {
				console.log(`Трейд #${offer.id} отправлен успешно`);
			}
		});
	});
}

 

Link to comment
Share on other sites

  • 2 weeks later...

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