keler Posted April 19 Report Posted April 19 (edited) After a while, the manager.on('new Offer', function(offer) stops working and the console.log line appears("New offer #" + Offer.id + " from " + Offer.partner.getSteam3RenderedID() + Offer. message) The incoming transaction is not displayed. When I manually restart the code, the streams become visible after using the use AccessToken. const FS = require('fs'); const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const SteamCommunity = require('steamcommunity'); const TradeOfferManager = require('steam-tradeoffer-manager'); const client = new SteamUser(); const community = new SteamCommunity(); const manager = new TradeOfferManager({ steam: client, community: community, language: 'en', useAccessToken: 'true' }); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, 'identity_secret'); }); const logOnOptions = { accountName: 'accountName', password: 'password', twoFactorCode: SteamTotp.generateAuthCode('shared_secret') }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('Logged into Steam'); client.setPersona(SteamUser.EPersonaState.Online); client.gamesPlayed(440); }); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, 'identity_secret'); }); manager.on('newOffer', function(offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID() + offer.message); if (/text/.test(offer.message)){ 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("identitySecret", offer.id, function(err) { if (err) { console.log("Can't confirm trade offer: " + err.message); } else { console.log("Trade offer " + offer.id + " confirmed"); } }); } } });} }); 334 / 5 000 Результаты перевода Перевод Через некоторое время менеджер.on('newOffer', function(offer) перестает работать и появляется строка console.log("Новое предложение #" + Offer.id + " from " + Offer.partner.getSteam3RenderedID() + Offer. message) Когда я вручную перезапускаю код, потоки становятся видимыми после использования useAccessToken. Steam_accept.js Edited April 20 by keler Quote
keler Posted April 20 Author Report Posted April 20 (edited) 19.04.2024 в 19:38, Келер сказал: Edited April 21 by keler Quote
Recommended Posts
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.