Jump to content
McKay Development

TypeError: community.acceptConfirmationForObject is not a function


Recommended Posts

Ive tried running the basic storehouse example about 20 times, tried importing in es6 and as a cjs file but I keep running into the same error over and over again.

In the other steamcommunity storehouse example it seems to have trouble even logging into community.

Secrets and login details are correct, it logs in and sda works with those secrets, but for some reason I keep getting this error:

TypeError: community.acceptConfirmationForObject is not a function.

Log:

Logged into Steam

Then a hundred lines like this:

(node:8784) TimeoutOverflowWarning: 1676962332106 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
(node:8784) TimeoutOverflowWarning: 1676962332107 does not fit into a 32-bit signed integer.
Timeout duration was set to 1.

 

Then api key shows correctly

 

New offer #5762908459 from [U:1:1045770003]
Offer accepted: pending
C:\Users\user\Desktop\app\bot\app.cjs:67
                                community.acceptConfirmationForObject(ids, offer.id, function(err) {
                                          ^

TypeError: community.acceptConfirmationForObject is not a function
    at C:\Users\user\Desktop\app\bot\app.cjs:67:15
    at TradeOffer.<anonymous> (C:\Users\user\Desktop\app\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:618:5)
    at C:\Users\user\Desktop\app\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:658:3
    at C:\Users\user\Desktop\app\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:48:4
    at checkNeededDescriptions (C:\Users\user\Desktop\app\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:174:3)
    at C:\Users\user\Desktop\app\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:42:3
    at SteamCommunity.<anonymous> (C:\Users\user\Desktop\app\node_modules\steam-tradeoffer-manager\lib\webapi.js:46:3)
    at Request._callback (C:\Users\user\Desktop\app\node_modules\steam-tradeoffer-manager\node_modules\steamcommunity\components\http.js:67:15)
    at self.callback (C:\Users\user\Desktop\app\node_modules\request\request.js:185:22)
    at Request.emit (node:events:513:28)

Node.js v18.12.1

 

Heres my code:

const SteamUser = require('steam-user');
const SteamCommunity = require('steamcommunity');
const SteamTotp = require('steam-totp');
const TradeOfferManager = require('steam-tradeoffer-manager')
const FS = require('fs');



 
let client = new SteamUser();
let manager = new TradeOfferManager({
    "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam
    "domain": "example.com", // Our domain is example.com
    "language": "en", // We want English item descriptions
    "pollInterval": 15000
});
let community = new SteamCommunity();
 
// Steam logon options
let logOnOptions = {
    "accountName": usr,
    "password": pwd,
    "twoFactorCode": SteamTotp.getAuthCode(sds)
};
 
if (FS.existsSync('polldata.json')) {
    manager.pollData = JSON.parse(FS.readFileSync('polldata.json').toString('utf8'));
}
 
client.logOn(logOnOptions);
 
client.on('loggedOn', function() {
    console.log("Logged into Steam");
});
 
client.on('webSession', function(sessionID, cookies) {
    manager.setCookies(cookies, function(err) {
        if (err) {
            console.log(err);
            process.exit(1); // Fatal error since we couldn't get our API key
            return;
        }
 
        console.log("Got API key: " + manager.apiKey);
    });
 
    community.setCookies(cookies);
});
 
manager.on('newOffer', function(offer) {
    console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID());
    offer.accept(function(err, status) {
        if (err) {
            console.log("Unable to accept offer: " + err.message);
        } else {
            console.log("Offer accepted: " + status);
            if (status == "pending") {
                community.acceptConfirmationForObject(ids, offer.id, function(err) {
                    if (err) {
                        console.log("Can't confirm trade offer: " + err.message);
                    } else {
                        console.log("Trade offer " + offer.id + " confirmed");
                    }
                })
            };
        }
    });
});


 
manager.on('pollData', function(pollData) {
    FS.writeFileSync('polldata.json', JSON.stringify(pollData));
});
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...