Jump to content
McKay Development

TheMaster

Member
  • Posts

    28
  • Joined

  • Last visited

Posts posted by TheMaster

  1. 11 minutes ago, Dr. McKay said:

    You're treating the symptom, not the cause. There's no scenario where this.partner should be undefined or otherwise invalid unless you're doing something wrong.

    I have treated the error on my end I was calling the send offer without checking partner so I fixed it I am suggesting that the error should be handled gracefully as u have written the error message but instead it crashes code

    Respectfully,

     

  2. On 5/11/2024 at 4:40 AM, Dr. McKay said:

    Show how you're creating a trade offer (new TradeOffer(...))

    i am very sorry for the late reply it seemslike the the error was happening when i was calling the sendoffer function with in valid or incomplete details but instead of showing what was the  cause it was crashing the program with the above error so i adjusted the main if statement on the new trade offer to 
     

        if (!this.partner?.isValid || !this.partner?.isValid() || this.partner?.type != SteamID.Type.INDIVIDUAL) {
            throw new Error("Invalid input SteamID " + this.partner);
        }
    in this way we safely access or try to access the contents and dosent crashes the program 
  3. if have no clue what this error means it started coming suddenly my account is fine 
     

    E:\Bots\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:19
            if (!this.partner.isValid || !this.partner.isValid() || this.partner.type != SteamID.Type.INDIVIDUAL) {
                              ^

    TypeError: Cannot read properties of undefined (reading 'isValid')
        at new TradeOffer (E:\Bots\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:19:20)
        at TradeOfferManager.createOffer (E:\Bots\node_modules\steam-tradeoffer-manager\lib\index.js:506:14)
        at sendOffer (E:\Bots\Autoconfirmbot\mainimprovements.js:168:25)
        at WebSocket.incoming (E:\Bots\Autoconfirmbot\modules\shadowpaysell.js:116:17)
        at WebSocket.emit (node:events:520:28)
        at Receiver.receiverOnMessage (E:\Bots\node_modules\ws\lib\websocket.js:1209:20)
        at Receiver.emit (node:events:520:28)
        at Receiver.dataMessage (E:\Bots\node_modules\ws\lib\receiver.js:594:14)
        at Receiver.getData (E:\Bots\node_modules\ws\lib\receiver.js:496:10)
        at Receiver.startLoop (E:\Bots\node_modules\ws\lib\receiver.js:167:16)

    Node.js v22.1.0

  4. can i create a trade offer with only the trade token of a user the website endpoint doesnot provide the steam id 32 or steam id 64 i an looking at this but we are still giving the steam id of user 

    var offer = manager.createOffer(new TradeOfferManager.SteamID("76561198006409530"), "KYworVTM"); // trade token provided
  5. 16 hours ago, nickmura aka bobby said:

    I've upgraded to the latest package and my types say that the steamTradeOfferManagerr does not have the `useAccessToken` property. Any ideas? The event listener just literally doesn't listen for new trades all of a sudden lmfao

     

    mind sharing the code

    ur statement is too vague

  6. @Dr. McKay
    idk y this error is arising

    C:\Autoconfirmbot\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:19
            if (!this.partner.isValid || !this.partner.isValid() || this.partner.type != SteamID.Type.INDIVIDUAL) {
                              ^

    TypeError: Cannot read properties of undefined (reading 'isValid')
        at new TradeOffer (C:\Autoconfirmbot\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:19:20)
        at TradeOfferManager.createOffer (C:\Autoconfirmbot\node_modules\steam-tradeoffer-manager\lib\index.js:506:14)
        at sendOffer (C:\Autoconfirmbot\mainimprovements.js:158:25)
        at Object.sellerforwax (C:\Autoconfirmbot\modules\waxpeer.js:26:11)
        at SteamUser.<anonymous> (C:\Autoconfirmbot\mainimprovements.js:317:13)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

  7. getting this error idk y this is caused and how to handle this 
     

    C:\New folder\node_modules\steamcommunity\components\http.js:108
                    err = new Error("HTTP error " + response.statusCode);
                          ^

    Error: HTTP error 503
        at SteamCommunity._checkHttpError (C:\New folder\node_modules\steamcommunity\components\http.js:108:9)
        at Request._callback (C:\New folder\node_modules\steamcommunity\components\http.js:50:61)
        at self.callback (C:\New folder\node_modules\request\request.js:185:22)
        at Request.emit (node:events:519:28)
        at Request.<anonymous> (C:\New folder\node_modules\request\request.js:1154:10)
        at Request.emit (node:events:519:28)
        at Gunzip.<anonymous> (C:\New folder\node_modules\request\request.js:1076:12)
        at Object.onceWrapper (node:events:633:28)
        at Gunzip.emit (node:events:519:28)
        at endReadableNT (node:internal/streams/readable:1696:12) {
      code: 503
    }

    Node.js v21.7.1

  8. ummm i have a problem idk y this is happening  can anyone diagnose? the below is the only connection logic

        client.logOn(logOnOptions);
     
        client.on('loggedOn', function() {
            console.log(green,`Logged into Steam ${accname}`);
        });
       
        setInterval(() => {
            if (!client.steamID) {
                client.logOn(logOnOptions);
            }
        },600000); // 10 mins 600000
        setInterval(() => {
            if (!client.steamID) {
                client.logOn(logOnOptions);
            }else{
            client.webLogOn();
            }
        },3600000); // 1 hour 3600000


    C:\New folder\node_modules\steam-user\components\09-logon.js:49
                    let alreadyConnectingError = new Error('Already attempting to log on, cannot log on again');
                                                 ^

    Error: Already attempting to log on, cannot log on again
        at SteamUser.logOn (C:\New folder\node_modules\steam-user\components\09-logon.js:49:32)
        at Timeout._onTimeout (C:\New folder\mainimprovements.js:788:20)
        at listOnTimeout (node:internal/timers:573:17)
        at process.processTimers (node:internal/timers:514:7)

    Node.js v21.7.1

  9. On 4/9/2024 at 1:14 AM, Toshima said:

    u talk about "StayOnline" method? it's looks like your own method. I would be grateful if you share it, cuz event "sessionExpired" in tradeoffer-manager not working as i expected.  


    I don’t quite understand how the "sessionExpired" event is triggered, because at some point incoming exchanges stop being processed and the "newOffer" event does not fire and the session expired event also does not fire anything...still testing

    well that seems like a bigger problem with your connection logic the session websession even is called when ever ur current websession expires its a automatic process and does not require ur intervention u need to look at ur reconnection or the weblogon etc stuff i think

     

  10. 2 hours ago, Toshima said:

    thanks, it's work well, but definitely the same as using steam-session
     

    NP, and definitely your choice this function and method automatically updates the access token when ever the websession is established and the plus point is that u dont need to write another function to me its more compact 

  11. 11 hours ago, venfiw said:

     

     

    i am trying to use apikey to check friends list, when people send me check on steam messagebox

    but i today i find my checklink and find apikey is null

    but it works before

     

    i find the answer at here :That's the point. Enabling useAccessToken disable fetching an API key.

     

    just use the getwebapi method in other libraries like node steam community
     

        async function getWebApiKey() {
            return new Promise((resolve, reject) => {
                community.getWebApiKey((err, key) => {
                    if (err) {
                        reject(err);
                    } else {
                        webapi=key
                        console.log(green,"Got API key: " + webapi);
                        resolve(key);
                    }
                });
            });
        }
  12. On 4/5/2024 at 7:08 PM, Toshima said:

    Is there a way to retrieve accessToken using tradeoffer-manager?

    acutally u can listed to client.on wesbsession as it has the callback cookies u and the steam login secre cookie u can extract the access token from there ill give u the function to do that
     

    function extractJWTToken(tokenString) {
        const jwtRegex = /ey[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_.+/=]+/;
        const jwtToken = tokenString.match(jwtRegex);
        return jwtToken ? jwtToken[0] : null;
    }
        client.on('webSession', async (sessionID, cookies) => {
            //console.log(cookies)
            let jwtToken = extractJWTToken(cookies[0])
            //console.log(jwtToken)
            cookiesformarket=jwtToken
            manager.setCookies(cookies, function(err) {
                //console.log(cookies)
                if (err) {
                    console.log(red,err);
                    process.exit(1); // Fatal error since we couldn't get our API key
                    return;
                }
                safePromise(withTimeout(stayOnline(refreshToken, marketapi,cookiesformarket), 10000,"stayOnline")) // Adjust timeout as needed
                .catch(error => console.error(red,'Error staying online:', error)); // Error handling
                //webapi=manager.apiKey
                //fetchActiveTradeOffers(); // Call the function
     
            }
            );
    21 hours ago, Dr. McKay said:

    No, use steam-session for that.

    can u testify my answer?

  13. 17 hours ago, loganWP said:

    You need to update package to latest version and add useAccessToken: true to your constructor :)

    Like this 

     

    this.steamTradeofferManager = new steamTradeofferManager({
            domain: "localhost",
            language: "en",
            community: this.steamcommunity,
            pollInterval: steamTradeofferManagerPollInterval,
            useAccessToken: true
        });

    nice helping people out 

  14. 3 hours ago, loganWP said:
    this.steamTradeofferManager = new steamTradeofferManager({
            domain: "localhost",
            language: "en",
            community: this.steamcommunity,
            pollInterval: steamTradeofferManagerPollInterval,
            useAccessToken: true
        });

     

    you need to add this to constructor useAccessToken: true

    yo man thank u very much u sve me a lot of hassle how u found this tho?

    5 minutes ago, TheMaster said:

    yo man thank u very much u sve me a lot of hassle how u found this tho?

    but when i use this the webapi is null its not getting the webapi correctly

     

        client.on('webSession', async (sessionID, cookies) => {
            manager.setCookies(cookies, function(err) {
                if (err) {
                    console.log(red,err);
                    process.exit(1); // Fatal error since we couldn't get our API key
                    return;
                }
                console.log(green,"Got API key: " + manager.apiKey);
                webapi=manager.apiKey
                //fetchActiveTradeOffers(); // Call the function
            }
            );
     
  15. 8 hours ago, Dr. McKay said:

    You just need to call setCookies each time the webSession event is emitted. You don't need to create a new TradeOfferManager or SteamCommunity.

    understood sir one more question this is a utmost importance i am looking to automatically loginto websites using steam i found that steam uses OPENID2 but i have no clue how to loginto through steam using that are i have seen the node steam user and the community can u point me what to do here?

  16. ok i will set a timer to run that function ever 1 hour and let u know the results however this maybe a dumb question please excuse my ignorance but we are sending the client once to the steam-tradeoffer-manager if we webLogOn() this will update the client in the steam tradeoffer manager too or do we have to create a new object

        const steamOptions = { autoRelogin: true,
                               httpProxy : proxy };
        let client = new SteamUser(steamOptions);
        const communityOptions = {};
        communityOptions.request = Request.defaults({ 'proxy': proxy });
        let community = new SteamCommunity(communityOptions);
        let manager = new TradeOfferManager({
            "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam
            "domain": "localhost", // Our domain is example.com
            "language": "en" // We want English item descriptions
        });
  17.                 if (config.steam.acceptOffers) {
                        // Accepts all offers empty from our side
                        this.managers[config.steam.accountName].on("newOffer", (offer) => {
                            if (offer.itemsToGive.length > 0 &&
                                !offer.isOurOffer) {
                                // offer.decline();
                            }
                            else {
                                offer.accept();
                            }
                        });
                    }
  18. think that the session is disconnected far too often while in client and the browser on which we are logged in the session dosent break for months i think that alot of sessions make and break also alert steam is there are a way to keep the session open for a long time as i can see there are a number of ways to sign into steam using steam-user   
    P.S 

    i am using the accname pass and the guard code for login 
     

    also by using this approach for example i run my bot for 1 day the client we are sending over to steam-tradeoffer-manager expires and it begins to give error message 
    Error= Not Logged IN

×
×
  • Create New...