Jump to content
McKay Development

lll

Member
  • Content Count

    10
  • Joined

  • Last visited

  1. This definitely happens after login, and most likely has something to do with the change of public IP(before relogin)
  2. constructor(details, db) { this.user = new SteamUser({ machineIdType: 3 }); this.community = new SteamCommunity({ request: this.request, userAgent }); this.manager = new TradeOfferManager({ steam: this.user, community: this.community, domain: process.env.logInDomain, language: 'en' }); this._jar = this.community._jar; this._logInDetails = details; this.user.on('error', () => { this.logOut(); }); this.user.on(
  3. This topic https://dev.doctormckay.com/topic/365-cookies/#user-cookieusage says after authorization (webSession emit) i call my method to set cookie: setCookies(cookies) { return util .promisify(this.manager.setCookies) .call(this.manager, cookies); } and then it sometimes happens when I try to call this.community.acceptConfirmationForObject: D:\projects\terminal\node_modules\steamcommunity\components\confirmations.js:247 throw new Error("Must be logged in before trying to do anything with confirmations");
  4. After I log out hrough my method logOut() { this.manager.shutdown(); this.user.logOff(); } there is one non-closed timer on - (43200000 ~ 12 hr) (anonymous) @ ...\steamcommunity\components\confirmations.js:172 and therefore my program does not exit correctly
  5. no, this class field is not initialized through the constructor, so this is not needed this code is equivalent of export default class Bot { constructor(details, db) { this.jar = request.jar(); this.request = request.defaults({ jar: this.jar, headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36' } }); this.community = new SteamCommunity({ request: this.request }); } }
  6. and another question, why the cookie jar is not used, which is passed in request.defaults export default class Bot { jar = request.jar(); request = request.defaults({ jar: this.jar, headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36' } }); constructor(details, db) { this.community = new SteamCommunity({ request: this.request }); } } after login and several requests, I can’t get Steam cookies in jar
  7. request has been deprecated, so is planned to switch to another requests lib?
  8. This logic will be written in the constructor. Something like this : constructor(accountName) { this.setCookies = util.promisify(this.manager.setCookies).bind(this.manager); this.user.on('error', this.logOut); this.user.on('loginKey', loginKey => db.findOne('bot', { accountName }, { loginKey })); }
  9. I have a Bot class and an async method for logIn, are there any better way for writing this method? completeLogin(botDetails, useLoginKey) { this.user.logOn(this.details(botDetails, useLoginKey)); return new Promise((done, reject) => { const cxt = this; async function success(_, cookies) { try { await cxt.setCookies(cookies); cxt.user.off('error', failed); done(); } catch(err) { reject(err); } } function failed(err) { cxt.user.
×
×
  • Create New...