Jump to content
McKay Development

Errror 404 while declining offer.


Recommended Posts

While offer.accept() works fine but for some reason offer.decline() gives me an error

Error: HTTP error 404
    at SteamCommunity._checkHttpError (C:\Users\HP\node_modules\steamcommunity\components\http.js:108:9)
    at Request._callback (C:\Users\HP\node_modules\steamcommunity\components\http.js:50:61)
    at Request.self.callback (C:\Users\HP\node_modules\request\request.js:185:22)
    at Request.emit (events.js:400:28)
    at Request.<anonymous> (C:\Users\HP\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:400:28)
    at IncomingMessage.<anonymous> (C:\Users\HP\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (events.js:519:28)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12) {
  code: 404,
  body: '<html>\n' +
    '<head>\n' +
    '<title>404 Not Found</title>\n' +
    '</head>\n' +
    '<body>\n' +
    '<h1>Not Found</h1>\n' +
    '</body>\n' +
    '</html>'
}

Here are those 2 functions that i use for accept and decline offer

function acceptOffer(offer){
    offer.accept((err) =>{
        community.checkConfirmations();
        console.log("offer accepted");
        console.log("trader id: "+offer.partner.getSteamID64());
        if(offer.partner.getSteamID64() != config.ownerID){
        client.chatMessage(offer.partner.getSteamID64(),"Offer accepted. Thanks for an offer");
        }
        if (err){ 
          console.log("there was an error in accepting")
          console.log(err);
          client.chatMessage(offer.partner.getSteamID64(),"There was en error to accept offer. Try again leater");
        }
    });
}

function declineOffer(offer){
  if (offer.partner.getSteamID64() == config.ownerID){
    acceptOffer(offer);
    console.log("hi");
  }else{
    offer.decline((err) =>{
        console.log("offer decliend");
        console.log("trader id: "+offer.partner.getSteamID64());
        if (err) console.log("there was an error in declining");
        console.log(err)
    });
  }
}

 

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