Jump to content
McKay Development

Recommended Posts

Posted (edited)

Hey! I'm kinda new to node, and to async programming at all.

So I'm sending multiple trade offers with a for loop and Im getting a null offer.id on them. I understood that I have to do a callback but I don't know how.

Can you please tell me how to do a callback on the offer.send function.

 

Thanks in advance!

Edited by dest0x
Posted (edited)

Okay, so I did the callback but the id of the first offer is still null

 

Here is my code

 

sendTradeOffer.send(function(err, status) {
     if (err) {
         console.log(err);
     }
     console.log("Offer #" + sendTradeOffer.id + " " + status);
});

 

Console

Offer #null sent
Offer #2747509293 sent
Edited by dest0x

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