DoctorMcKay / node-steamcommunity

Interact with various interfaces on Steam Community from Node.js
https://dev.doctormckay.com/forum/8-node-steamcommunity/
MIT License
475 stars 128 forks source link

Webauth failed: this._community.setCookies is not a function #298

Closed Andrew3019 closed 2 years ago

Andrew3019 commented 2 years ago

My code:

const SteamCommunity = require("steam-community");
const community = new SteamCommunity();
client.on('webSession', (sessionid, cookies) => {
    manager.setCookies(cookies);
    community.setCookies(cookies);
    // community.startConfirmationChecker(30000, config.identity_secret);

    console.log(cookies)

Console output with debugging:

Sending message: ClientRequestWebAPIAuthenticateUserNonce
Handled message: ClientPersonaState
Handled message: ClientRequestWebAPIAuthenticateUserNonceResponse
API POST request to https://api.steampowered.com/ISteamUserAuth/AuthenticateUser/v0001/:200
Webauth failed: this._community.setCookies is not a function
DoctorMcKay commented 2 years ago

This error is probably coming from TradeOfferManager. Show me your TradeOfferManager constructor and versions.

Andrew3019 commented 2 years ago
+-- bytenode@1.1.7
+-- crypto@1.0.1
+-- globaloffensive@2.1.0
+-- steam-community@0.2.2
+-- steam-tradeoffer-manager@2.10.5
+-- steam-user@4.25.0
`-- sync-request@6.1.0
const SteamUser = require("steam-user");
const SteamTotp = require('steam-totp');
const SteamCommunity = require("steam-community");
const TradeOfferManager = require("steam-tradeoffer-manager");
const config = require('./../config.js');
// const { MemoryCookieStore } = require("tough-cookie");

const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager({
    steam: client,
    community: community,
    language: "en",
});

// console.log(manager.username)
// console.log(manager.loadInventory)
const logOnOptions = {
    accountName:config.accountName,
    password:config.password,
    twoFactorCode: SteamTotp.generateAuthCode(config.sharedSecret)
}
client.on('debug', (msg) => console.log(msg));
client.logOn(logOnOptions)

client.on("loggedOn", () => {
    console.log('succesfully logged on: ' + client.steamID);
    client.setPersona(SteamUser.EPersonaState.Online);
})

client.on('webSession', (sessionid, cookies) => {
    manager.setCookies(cookies);
    community.setCookies(cookies);
    // community.startConfirmationChecker(30000, config.identity_secret);

    console.log(cookies)
    console.log("Getting offers...")
    manager.getOffers("ActiveOnly", (err, sent, received) => {
        if (err) throw err;
        console.log("Results:")
        console.log(sent)
        console.log(received)
    })
})
Andrew3019 commented 2 years ago

Ok, it seems like I downloaded steam-community and not steamcommunity

Revadike commented 2 years ago

AmongUsUsGIF