Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: malformed response #80

Closed
woepertjes opened this issue Mar 20, 2018 · 2 comments
Closed

Error: malformed response #80

woepertjes opened this issue Mar 20, 2018 · 2 comments

Comments

@woepertjes
Copy link

woepertjes commented Mar 20, 2018

Tiny bit of background:
I've got multiple bots, B1 to B7.
B1 is the receiving bot shall i say. It's supposed to send a tradeoffer (function seen below), the command works though i get the following error: Error: "Malformed response".

What the bot is supposed to do:

  1. Receive command
  2. create tradeoffer
  3. send tradeoffer

after these three steps its supposed to wait till the offer is accepted.

The context ID for csgo cases is 2, the appid of csgo is 730. so i dont really know whats causing this problem. the bots are always online and logged in.

function tradecases(botid, senderid) {
    var appid = 730;
    var contextid1 = 2;
    
    bots[botid].offers.loadInventory(appid, contextid1, true, (err, myInv) => {
        if (err) {
            logger.error(err);
        } else {
            bots[botid].offers.loadUserInventory(senderid, appid, contextid1, true, (err, theirInv) => {
                if (err) {
                    logger.error(err);
                } else {
                    var theirItem = theirInv
                  bots[botid].offers.offer.addTheirItem(theirInv);

                  bots[botid].offers.offer.setMessage('This is an automated tradeoffer for all your trading cards. You can change it if you want.');
                  bots[botid].offers.offer.send((err, status) => {
                      if (err) {
                          logger.error(err);
                      } else logger.info('sent offer status: ' + status);
                  });
                }
            });
        }
    });
}

any ideas anyone?

@andrewda
Copy link
Owner

Verify that the bot is correctly logging in and that senderid is what you think it is. Where is the error being thrown? loadInventory, loadUserInventory or offer.send?

@woepertjes
Copy link
Author

this is the error im getting:

verbose: [B1] Received message from non-botadmin: !test error: Error: Malformed response at SteamCommunity.<anonymous> (F:\va\node_modules\steamcommun ity\components\users.js:309:15) at Request._callback (F:\va\node_modules\steamcommunity\compo nents\http.js:67:15) at Request.self.callback (F:\va\node_modules\request\request. js:186:22) at Request.emit (events.js:180:13) at Request.<anonymous> (F:\va\node_modules\request\request.js :1163:10) at Request.emit (events.js:180:13) at IncomingMessage.<anonymous> (F:\va\node_modules\request\re quest.js:1085:12) at Object.onceWrapper (events.js:272:13) at IncomingMessage.emit (events.js:185:15) at endReadableNT (_stream_readable.js:1101:12)

Bot is logging in correctly, senderid is what i think it is (person who sent the command). last but not least i dont see where the error is being thrown. It's possible that im looking over it, my eyes arent what they used to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants