Jump to content
McKay Development

Search the Community

Showing results for tags 'instantiation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News & Announcements
    • Releases & Updates
  • Help & Support
    • General
    • Guides
    • node-steam-user
    • node-steamcommunity
    • node-steam-tradeoffer-manager
    • node-steam-session

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL




Found 1 result

  1. I have a web app that processes steam trades. The goal is to log into steamcommunity with user/pass/2fa once on startup, then use the logged in community object to create offers when trades are processed. I have the current code which seems to successfully process trades (I can't know for sure as the bot account had 2FA enabled just a few days ago), the problem is that every time a trade is processed, a community login is required. If I remember correctly, you can only log in with 2FA once every 30 seconds. For my use case, this is a limitation I am hoping to avoid. import two from './twofactor_76561199485326357.json'; import {TItemsAsset} from "@/helpers/steamTypes"; var SteamTotp = require('steam-totp'); var TradeOfferManager = require('steam-tradeoffer-manager'); var SteamCommunity = require('steamcommunity'); var community = new SteamCommunity(); require('dotenv').config(); export default function createOffer(tradeURL: string, items: TItemsAsset[]) { var logOnOptions = { accountName: process.env.BOT_USER, password: process.env.BOT_PASS, twoFactorCode: SteamTotp.generateAuthCode(two.shared_secret), } community.login(logOnOptions, (err: Error) => { if (err) { console.log('Error logging into community'); throw Error; } else { console.log('Successfully logged into community as ' + logOnOptions.accountName); var manager = new TradeOfferManager({ "community": community, "pollInterval": 5000, "cancelTime": 180000, "pendingCancelTime": 180000, "domain": (process.env.NODE_ENV !== 'production' ? 'localhost:3000' : 'mywebsite.com'), "language": "en", }) let offer = manager.createOffer(tradeURL); //offer.addTheirItems(items.map(item => ({ appid: item.assetid, contextid: item.contextid, assetid: item.assetid }))); offer.addTheirItem({ appid: 730, contextid: 2, assetid: 19506293513 }) offer.setMessage('Items from bounty creator'); offer.send(function(err: Error, status: string) { if (err) { console.log('send err: ' + err); throw Error; } else if (status === 'pending') { community.acceptConfirmationForObject(two.identity_secret, offer.id, (err: Error) => { if (err) { console.log('confirm err: ' + err); } else { console.log('Offer confirmed'); } }); } else { console.log('trade offer sent successfully'); } }); } }); } I respect your time and am not asking you to teach me basic javascript principles, but if you could point me in the right direction that would be very much appreciated. Thanks for creating these libraries, - b_zy
  • Create New...