Jump to content


Photo

Error

node.js node-steam-tradeoffer-manager

  • Please log in to reply
3 replies to this topic

#1 Nikols

Nikols

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 03 July 2018 - 12:43 PM

When i send chat command to activate this I get error which i dont know to fix. If i leave just my item  it is same.

 

D:\Radna površina\bot\node_modules\steamcommunity\components\users.js:342
                                callback(null, inventory, currency);
                                ^

TypeError: callback is not a function
    at SteamCommunity.<anonymous> (D:\Radna površina\bot\node_modules\steamcommunity\components\users.js:342:5)
    at Request._callback (D:\Radna površina\bot\node_modules\steamcommunity\components\http.js:67:15)
    at Request.self.callback (D:\Radna površina\bot\node_modules\request\request.js:185:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (D:\Radna površina\bot\node_modules\request\request.js:1157:10)
    at Request.emit (events.js:182:13)
    at IncomingMessage.<anonymous> (D:\Radna površina\bot\node_modules\request\request.js:1079:12)
    at Object.onceWrapper (events.js:273:13)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1081:12)

D:\Radna površina\bot>pause
Press any key to continue . . .

D:\Radna površina\bot>pause
Press any key to continue . . .

 

code:

if(numberOfKeys > 10) { client.chatMessage(steamID, "You cannot buy that much"); }
                else {
                     var offer = manager.createOffer(steamID);
                     manager.loadInventory(753, 6, true, function(err, myItems) {
                            itemx = {
                                appid: 304930,
                                contextid: 2,
                                amount: 1,
                                assetid: '646664519304758668'
                            }
                            offer.addMyItem(itemx);
                            offer.loadPartnerInventory(753, 6,true, function(err, theirItems) {
                                if(err) {
                                console.log(err);
                                return;
                                        }
                            itemy =
                            {
                            appid: 753,
                            contextid: 6,
                            amount: 1,
                            assetid: '1922357299630920400'
                            }
                            offer.addTheirItem(itemy);
                            offer.send("");
                            });
                            });
                    
                    client.chatMessage(steamID, "Processing");
                }


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,810 posts

Posted 03 July 2018 - 02:15 PM

For the love of God, fix your indentation.

 

loadPartnerInventory doesn't have a tradableOnly param, so don't pass one.



#3 SnaBe

SnaBe

    Member

  • Member
  • PipPip
  • 15 posts
  • LocationDenmark

Posted 03 July 2018 - 02:17 PM

I thought the loadInventory method was outdated?


Edited by SnaBe, 03 July 2018 - 02:23 PM.


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,810 posts

Posted 03 July 2018 - 03:07 PM

It is.







Also tagged with one or more of these keywords: node.js, node-steam-tradeoffer-manager

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users