Jump to content
McKay Development

Search the Community

Showing results for tags 'Node.js'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Location


Interests

  1. Hello, im getting the "There was an error sending your trade offer. Please try again later. (26)" in some of mine trades even when i know, that the item exists. Im using something like this let theirInv = await promisify(manager, 'loadUserInventory', json[key].trader, appid, contextid, true); for (var i = 0; i < theirInv.length - 1; i++) { if (theirInv[i].app_data.def_index == key) { console.log("Debug: " + json[key].name + " added") offer.addTheirItem(theirInv[i]) } } The offer looks like this (before offer.send, because thats where i get error) TradeOffer { partner: SteamID { universe: 1, type: 1, instance: 1, accountid: 315218580 }, id: null, message: null, state: 1, itemsToGive: [ { id: '7722044888', assetid: '7722044888', appid: 440, contextid: '2', amount: 1 }, { id: '7722045038', assetid: '7722045038', appid: 440, contextid: '2', amount: 1 }, { id: '7722045095', assetid: '7722045095', appid: 440, contextid: '2', amount: 1 }, { id: '7722045165', assetid: '7722045165', appid: 440, contextid: '2', amount: 1 }, { id: '7722055059', assetid: '7722055059', appid: 440, contextid: '2', amount: 1 }, { id: '7722058221', assetid: '7722058221', appid: 440, contextid: '2', amount: 1 }, { id: '7722058247', assetid: '7722058247', appid: 440, contextid: '2', amount: 1 }, { id: '7722058269', assetid: '7722058269', appid: 440, contextid: '2', amount: 1 }, { id: '7722058299', assetid: '7722058299', appid: 440, contextid: '2', amount: 1 }, { id: '7722058320', assetid: '7722058320', appid: 440, contextid: '2', amount: 1 }, { id: '7722058338', assetid: '7722058338', appid: 440, contextid: '2', amount: 1 }, { id: '7722058357', assetid: '7722058357', appid: 440, contextid: '2', amount: 1 }, { id: '7722058379', assetid: '7722058379', appid: 440, contextid: '2', amount: 1 }, { id: '7722058395', assetid: '7722058395', appid: 440, contextid: '2', amount: 1 }, { id: '7722058419', assetid: '7722058419', appid: 440, contextid: '2', amount: 1 }, { id: '7722058438', assetid: '7722058438', appid: 440, contextid: '2', amount: 1 }, { id: '7722058459', assetid: '7722058459', appid: 440, contextid: '2', amount: 1 }, { id: '7722058472', assetid: '7722058472', appid: 440, contextid: '2', amount: 1 }, { id: '7722058489', assetid: '7722058489', appid: 440, contextid: '2', amount: 1 }, { id: '7722058502', assetid: '7722058502', appid: 440, contextid: '2', amount: 1 }, { id: '7722058515', assetid: '7722058515', appid: 440, contextid: '2', amount: 1 }, { id: '7722058535', assetid: '7722058535', appid: 440, contextid: '2', amount: 1 }, { id: '7722058552', assetid: '7722058552', appid: 440, contextid: '2', amount: 1 }, { id: '7722058572', assetid: '7722058572', appid: 440, contextid: '2', amount: 1 }, { id: '7722103419', assetid: '7722103419', appid: 440, contextid: '2', amount: 1 }, { id: '7707303984', assetid: '7707303984', appid: 440, contextid: '2', amount: 1 } ], itemsToReceive: [ { id: '4439006249', assetid: '4439006249', appid: 440, contextid: '2', amount: 1 } ], isOurOffer: true, created: null, updated: null, expires: null, tradeID: null, fromRealTimeTrade: false, confirmationMethod: null, escrowEnds: null, rawJson: '' }All items have ID so they "exists" (at least i think about it this way). Manual trade offer with this items works fine. I could send a txt with inventory json if needed.
  2. Hey I'm making my first bot so I'm trying to experiment with a bunch of simple features. But I cannot seem to get posting to steam profile comments working. I can post a comment on the same account using the browser, but if I do it with the bot I get the error 'The settings on that account do not allow you to add comments.' I think I have the same issue as this person: https://github.com/DoctorMcKay/node-steamcommunity/issues/217 So I'm wondering if I have tripped it, and what I can do to not trip it? I'm using my own personal account to test with and I'm trying to post comments in response to a message so my account will have been logged in for a while, it's not like I'm spamming either it's just 1 comment so I am out of ideas.
  3. Hello, I was messing around with the UIMode status and saw that VR was missing, This file hasn't been touched since 1 Jun 2016 so I also assume you haven't revised it or looked into it at a later given time? I was wondering if you could revisit it and perhaps add it if possible? Thank you regardless, https://github.com/DoctorMcKay/node-steam-user#setuimodemode
  4. https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/blob/master/resources/ETradeOfferState.js If a person received or send trade, he accepted it on the computer, need confirmation on the phone, what is this state?
  5. Hi, how do I set that I'm playing a custom game in my profile. I tried placing the string first but still goes online and shows as playing a game with the first integer in my array client.gamesPlayed(["some string here", 730, 440, ..., ....]); edit: I made it work by via this: let x = "some string here"; let y = x.toString(); client.gamesPlayed([y, 730, 440, ..., ....]);
  6. How to get all the skins of their exchange, then to create an exchange with the same skins? let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=149081977&token=Cb2UfEHh"); offer.addMyItems(???????????); offer.send(function(err, status)
  7. I am writing the previous username used with the loginKey to a json file. steamUser.on("loginKey", key => { var loginInfo = { accountName: userInfo.accountName, loginKey: key }; var json = JSON.stringify(loginInfo); fs.writeFile("./login.json", json, "utf8", err => { if (err) { console.error(err); } }); }); userInfo is an object containing accountName and rememberPassword which the user enters on startup. This is the contents of the file "login.json" (Obviously I haven't included the username and loginKey in this post but they are there in the real thing) {"accountName":"","loginKey":""} I then load this file and use it with the logOn function: var SteamUser = require("steam-user"); var steamUser = new SteamUser(); ... var prevLogin = require("login.json"); prevLogin["rememberPassword"] = true; steamUser.logOn(prevLogin); Then I get this error: { Error: InvalidPassword at SteamUser.<anonymous> (/home/lenny/expanddong/steam-user-testing/node_modules/steam-user/components/logon.js:458:16) at handlers.forEach (/home/lenny/expanddong/steam-user-testing/node_modules/steam-user/components/classes/HandlerManager.js:37:12) at Array.forEach (<anonymous>) at HandlerManager.emit (/home/lenny/expanddong/steam-user-testing/node_modules/steam-user/components/classes/HandlerManager.js:36:12) at SteamUser._handleMessage (/home/lenny/expanddong/steam-user-testing/node_modules/steam-user/components/messages.js:532:24) at SteamUser._handleNetMessage (/home/lenny/expanddong/steam-user-testing/node_modules/steam-user/components/messages.js:467:7) at SteamUser.processMulti (/home/lenny/expanddong/steam-user-testing/node_modules/steam-user/components/messages.js:559:9) at SteamUser.<anonymous> (/home/lenny/expanddong/steam-user-testing/node_modules/steam-user/components/messages.js:553:16) at handlers.forEach (/home/lenny/expanddong/steam-user-testing/node_modules/steam-user/components/classes/HandlerManager.js:37:12) at Array.forEach (<anonymous>) eresult: 5 } So clearly I am doing something wrong. Is there some sort of tutorial on the correct way to do it? Or can someone tell me if they spot a mistake?
  8. Hello, I am trying to create a simple chat application that works with steam. But every time i have the user login, the user has to enter his steamGuard code, even when the sentryfiles are being saved to the dataDirectory. my steam-user object is made as follows: this.options = { autoRelogin: true, promptSteamGuardCode: false };this.client = new SteamUser(this.options); I currently login using: this.client.logOn({"accountName": username,"password": pass,"rememberPassword": true}); I also tried the setSentry method before calling the logOn method. this.client.setSentry(fs.readFileSync(path));Where path is the location of the sentryFile, i can see the sentry.USERNAME.bin files in my appdata. I also tried logging in with the loginKey recieved from the rememberPassword option, with no success. How do i make the steamGuard a one-time only thing, like it is supposed to be? I am probably missing something very simple. I have tried steam-user 4.0.0-beta.4 and 3.29.2, both have the same effect. Thanks for the effort beforehand, Iron.
  9. It was implemented to Steam relatively recently. Is this something to expect in a future release, or did I completely overlook something? Thanks.
  10. I need that when the trade was confirmed on the computer, it was canceled and a new one was created, with the same skins My code: manager.on('TradeOfferManager.ETradeOfferState[9]', function(offer, oldState) { let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=149081977&token=Cb2UfEHh"); offer.addMyItems(inventory); offer.send(function(err, status) { if (err) { console.log(err); return; } if (status == 'pending') { // We need to confirm it console.log("Items " + manager.getOffer); console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); } }); }); When I confirm the exchange on the computer, nothing happens . ETradeOfferState[3] - confirmed trade And another question, how to get things from the trade, then to create a trade with the same things? If ETradeOfferState[offer.state] = ETradeOfferState[9], trade must cancel, I do not know how to make a check offer.state when I get a newOffer or sentOfferChanged
  11. How can I get their trade items, and then use them in the trade I created? 1) I send trade.2) This trade is canceled.3) There is a trade with the same skins.
  12. Hello. I am using the TF2 npm. What I want is when I message the bot on steam a specific message e.g. deleteAllCrates it should delete all the crates. I've coded the messaging part I just need it to get the ID's off all the crates and put them in an array so I can do tf2.deleteItem(array) ^ would this work btw? Thanks in advance.
  13. Hello, I'm trying to set a config on a bot I found on the internet. I'm trying to set the name of the current game that I'm playing to something like "Boosting Hours" or any string. Also tried to set to Snooze like this: bot.setPersona(SteamUser.EPersonaState.Snooze); and didn't work... This is the bot: IdlerConfig.js var steamClientFactory = require('./steamClient.js'); var configsArray = []; var config; var botArray = []; config = {}; config.username = 'nick1'; config.password = 'pass1'; config.sharedSecret = ''; //Shared Secret(for 2FA only) https://github.com/Jessecar96/SteamDesktopAuthenticator/releases config.games = [730,440,570] configsArray.push(config); config = {}; config.username = 'nick2'; config.password = 'pass2'; config.sharedSecret = ''; //Shared Secret(for 2FA only) https://github.com/Jessecar96/SteamDesktopAuthenticator/releases config.games = [730,440,570] configsArray.push(config); console.log('Number of configurations set up: ' + configsArray.length); for (index = 0; index < configsArray.length; index++) { var config = configsArray[index]; var bot = steamClientFactory.buildBot(config); bot.doLogin(); botArray.push(bot); } console.log('Running ' + botArray.length + ' bots.'); steamClient.js var SteamUser = require('steam-user'); var SteamTotp = require('steam-totp'); var botFactory = {}; botFactory.buildBot = function (config) { var bot = new SteamUser({ promptSteamGuardCode: false, dataDirectory: "./sentry", singleSentryfile: false }); bot.username = config.username; bot.password = config.password; bot.sharedSecret = config.sharedSecret; bot.games = config.games; bot.messageReceived = {}; bot.on('loggedOn', function(details) { console.log("[" + this.username + "] Logged into Steam as " + bot.steamID.getSteam3RenderedID()); bot.setPersona(SteamUser.EPersonaState.Online); bot.gamesPlayed(this.games); }); bot.on('error', function(e) { console.log("[" + this.username + "] " + e); setTimeout(function() {bot.doLogin();}, 30*60*1000); }); bot.doLogin = function () { this.logOn({ "accountName": this.username, "password": this.password }); } bot.on('steamGuard', function(domain, callback) { if ( !this.sharedSecret ) { var readlineSync = require('readline-sync'); var authCode = readlineSync.question("[" + this.username + "] " + 'Steam Guard' + (!domain ? ' App' : '') + ' Code: '); callback(authCode); } else { var authCode = SteamTotp.generateAuthCode( this.sharedSecret ); console.log("[" + this.username + "] Generated Auth Code: " + authCode); callback(authCode); } }); bot.on("friendMessage", function(steamID, message) { console.log("[" + this.username + "] Message from " + steamID+ ": " + message); if ( !this.messageReceived[steamID] ) { bot.chatMessage(steamID, "[Automated Message] I am currently idle. I will respond when I am next available."); this.messageReceived[steamID] = true; } }); bot.on('vacBans', function(numBans, appids) { if(numBans > 0) { console.log( "[" + this.username + "] " + numBans + " VAC ban" + (numBans == 1 ? '' : 's') + "." + (appids.length == 0 ? '' : " In apps: " + appids.join(', ')) ); } }); bot.on('accountLimitations', function(limited, communityBanned, locked, canInviteFriends) { var limitations = []; if(limited) { limitations.push('LIMITED'); } if(communityBanned) { limitations.push('COMMUNITY BANNED'); } if(locked) { limitations.push('LOCKED'); } if(limitations.length !== 0) { console.log("[" + this.username + "] Limitations: " + limitations.join(', ') + "."); } }); return bot; } module.exports = botFactory; Can anyone help me? Thank you all
  14. I need that when the trade was confirmed on the computer, it was canceled and a new one was created, with the same skins My code: manager.on('TradeOfferManager.ETradeOfferState[9]', function(offer, oldState) { let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=149081977&token=Cb2UfEHh"); offer.addMyItems(inventory); offer.send(function(err, status) { if (err) { console.log(err); return; } if (status == 'pending') { // We need to confirm it console.log("Items " + manager.getOffer); console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); } }); }); When I confirm the exchange on the computer, nothing happens . ETradeOfferState[3] - confirmed trade And another question, how to get things from the trade, then to create a trade with the same things?
  15. I have code SteamCommunity.prototype.uploadAvatar = function(image, format, callback) { if(typeof format === 'function') { callback = format; format = null; } // are we logged in? if (!this.steamID) { callback(new Error("Not Logged In")); return; } var self = this; if(image instanceof Buffer) { doUpload(image); } else if(image.match(/^https?:\/\//)) { this.httpRequestGet({ "uri": image, "encoding": null }, function(err, response, body) { if(err || response.statusCode != 200) { if(callback) { callback(err ? new Error(err.message + " downloading image") : new Error("HTTP error " + response.statusCode + " downloading image")); } return; } if(!format) { format = response.headers['content-type']; } doUpload(body); }, "steamcommunity"); } else { if(!format) { format = image.match(/\.([^\.]+)$/); if(format) { format = format[1]; } } FS.readFile(image, function(err, file) { if(err) { if(callback) { callback(err); } return; } doUpload(file); }) } function doUpload(buffer) { if(!format) { if(callback) { callback(new Error("Unknown image format")); } return; } if(format.match(/^image\//)) { format = format.substring(6); } var filename = ''; var contentType = ''; switch(format.toLowerCase()) { case 'jpg': case 'jpeg': filename = 'avatar.jpg'; contentType = 'image/jpeg'; break; case 'png': filename = 'avatar.png'; contentType = 'image/png'; break; case 'gif': filename = 'avatar.gif'; contentType = 'image/gif'; break; default: if(callback) { callback(new Error("Unknown or invalid image format")); } return; } self.httpRequestPost({ "uri": "https://steamcommunity.com/actions/FileUploader", "formData": { "MAX_FILE_SIZE": buffer.length, "type": "player_avatar_image", "sId": self.steamID.getSteamID64(), "sessionid": self.getSessionID(), "doSub": 1, "json": 1, "avatar": { "value": buffer, "options": { "filename": filename, "contentType": contentType } } }, "json": true }, function(err, response, body) { if(err) { if(callback) { callback(err); } return; } if(body && !body.success && body.message) { if(callback) { callback(new Error(body.message)); } return; } if(response.statusCode != 200) { if(callback) { callback(new Error("HTTP error " + response.statusCode)); } return; } if(!body || !body.success) { if(callback) { callback(new Error("Malformed response")); } return; } if(callback) { callback(null, body.images.full); } }, "steamcommunity"); } }; How to choose a photo and upload it?
  16. Sometimes on sending tradeoffer bot will receive error from steam: "There was an error sending your trade offer. Please try again later. (16)" but in 5-60 seconds unknownOfferSent event fires 1-3 times with this exact trade (I triple checked that I create offer only once, with logs too), one of these offers will behave as usual and all others (if there are others) will have status InvalidItems. Usually it happens when steam lags Is it even possible? Or should I look for errors in my code?
  17. Hello, i've build my site and steam login with php, on trade situation, im running eligible paremeters with exec command.I just wanna ask is that a true way? Or should i save the paremeters when user need trade, and nodejs side should i check every 1 sec to db if there is a new task for bot?
  18. Hello, why sometimes my response ( { response: {} } ) is empty? Profile status and game are public.
  19. Hello. Can anyone make a code example on how to join a group chat, default "Home" channel?
  20. Good Day, I have the question about httpRequestGet & httpRequestPost functionality. Cookies for store.steampowered.com and steamcommunity.com websites are same, however there is no way how to interact with store.steampowered.com via httpRequestGet, because we are not able to setCookies via node-steamcommunity and there is no httpRequest functionality in node-steamstore. What would be the easiest solution? Thank you in advance.
  21. Hello here is my code, const SteamUser = require('steam-user'); const SteamCommunity = require('steamcommunity'); const SteamTotp = require('steam-totp'); const TradeManager = require('steam-tradeoffer-manager'); var self = null; var BotHandler = function(botConfig, tradeUrl, ownItems = "15702927052", theirItems= "") { this.tradeUrl = tradeUrl; this.ownItems = ownItems; this.theirItems = theirItems; this.config = botConfig; this.client = new SteamUser(); this.manager = new TradeManager({ 'steam': this.client, 'domain': 'xx', 'language': 'tr' }); this.community = new SteamCommunity(); this.logOnOptions = { 'accountName': botConfig.username, 'password': botConfig.password, 'twoFactorCode': SteamTotp.getAuthCode(botConfig.secret) }; self = this; }; BotHandler.prototype.start = function() { this.client.on('webSession', this.trade); this.client.logOn(this.logOnOptions); }; BotHandler.prototype.trade = function(sessionId, cookies) { self.manager.setCookies(cookies, self.getInventory); }; BotHandler.prototype.getInventory = function(error) { if(error) { throw error; return; } self.manager.getInventoryContents(self.config.appId, self.config.contextId, true, self.createOffer); }; BotHandler.prototype.createOffer = function(error, inventory) { if(error) { throw error; } var offer = self.manager.createOffer(self.tradeUrl); console.log(inventory); offer.addMyItem({ assetid: "15702927030", appid: self.config.appId, contextid: self.config.contextId, amount: 1 }); // for(var i = 0; i < self.ownItems.length; i++) { // offer.addMyItem({ // assetid: self.ownItems[i], // appid: self.config.appId, // contextid: self.config.contextId, // amount: 1 // }); // } // offer.addTheirItem({ // assetid: self.theirItems, // appid: self.config.appId, // contextid: self.config.contextId, // amount: 1 // }); // for(var i = 0; i < self.theirItems.length; i++) { // offer.addTheirItem({ // assetid: self.theirItems[i], // appid: self.config.appId, // contextid: self.config.contextId, // amount: 1 // }); // } offer.send((err, status) => { if (err) { console.log(err); } else { console.log('trade sent'); console.log(status); } }) }; BotHandler.prototype.acceptTrade = function(error, status) { if(err) { throw error; } if(status == 'pending') { console.log("pending"); }else { console.log('sent'); } }; module.exports = BotHandler; how can i accept auto the outgoing trade in mobile app? I got my identity secret vb in config
  22. Hey. I found a method to get steamApps of account. Would be great to see that in CSteamUser methods . Cookies must be provided. const xml = await new Promise((resolve_, reject_) => { this._community.httpRequestGet( `https://steamcommunity.com/profiles/[U:1:69762859]/games?xml=1`, (err: Error, result: any) => { if(err) reject_(err); resolve_(result.body); } ); }); //Sometimes iam getting ":0:" id part by SteamID.getSteam3RenderedID() and this method isn't work. //So i just replaced it with ":1:" and it works well at least on my tests.
  23. hello const SteamUser = require('steam-user'); const SteamCommunity = require('steamcommunity'); const SteamTotp = require('steam-totp'); const TradeManager = require('steam-tradeoffer-manager'); var self = null; var BotHandler = function(botConfig, tradeUrl, ownItems = "15702927052", theirItems= "") { this.tradeUrl = tradeUrl; this.ownItems = ownItems; this.theirItems = theirItems; this.config = botConfig; this.client = new SteamUser(); this.manager = new TradeManager({ 'steam': this.client, 'domain': 'skins.company', 'language': 'tr' }); this.community = new SteamCommunity(); this.logOnOptions = { 'accountName': botConfig.username, 'password': botConfig.password, 'twoFactorCode': SteamTotp.getAuthCode(botConfig.secret) }; self = this; }; BotHandler.prototype.start = function() { self.client.on('webSession', this.trade); self.client.logOn(self.logOnOptions); }; BotHandler.prototype.trade = function(sessionId, cookies) { self.manager.setCookies(cookies, self.getInventory); }; BotHandler.prototype.getInventory = function(error) { if(error) { throw error; } self.manager.getInventoryContents(self.config.appId, self.config.contextId, true, self.createOffer); }; BotHandler.prototype.createOffer = function(error, inventory) { if(error) { throw error; } var offer = self.manager.createOffer(self.tradeUrl); offer.addMyItem({ assetid: "15702927030", appid: self.config.appId, contextid: self.config.contextId, amount: 1 }); // for(var i = 0; i < self.ownItems.length; i++) { // offer.addMyItem({ // assetid: self.ownItems[i], // appid: self.config.appId, // contextid: self.config.contextId, // amount: 1 // }); // } // offer.addTheirItem({ // assetid: self.theirItems, // appid: self.config.appId, // contextid: self.config.contextId, // amount: 1 // }); // for(var i = 0; i < self.theirItems.length; i++) { // offer.addTheirItem({ // assetid: self.theirItems[i], // appid: self.config.appId, // contextid: self.config.contextId, // amount: 1 // }); // } offer.send((err,token, status) => { if (err) { console.log(err); } else { console.log('trade sent'); self.community.acceptConfirmationForObject(self.config.identitySecret); // HERE IS THE METHOD } }) }; // BotHandler.prototype.acceptTrade = function(error, status) { // if(err) { // throw error; // } // // if(status == 'pending') { // console.log("pending"); // }else { // console.log('sent'); // } // }; module.exports = BotHandler; ERROR Output F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247 throw new Error("Must be logged in before trying to do anything with confirmations"); ^ Error: Must be logged in before trying to do anything with confirmations at request (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247:9) at SteamCommunity.getConfirmations (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:17:2) at doConfirmation (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:182:8) at F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:170:4 at IncomingMessage.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\node_modules\steam-totp\index.js:129:4) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1103:12) at process._tickCallback (internal/process/next_tick.js:63:19) F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl "https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-" --ownList "5854236464" --theirList "15702811262" Promise { <pending> } Error: SteamGuardMobile at SteamCommunity.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\index.js:153:14) at Request._callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Gunzip.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13) at Gunzip.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1103:12) trade sent F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247 throw new Error("Must be logged in before trying to do anything with confirmations"); ^ Error: Must be logged in before trying to do anything with confirmations at request (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247:9) at SteamCommunity.getConfirmations (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:17:2) at doConfirmation (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:182:8) at F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:170:4 at IncomingMessage.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\node_modules\steam-totp\index.js:129:4) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1103:12) at process._tickCallback (internal/process/next_tick.js:63:19) F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl "https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-" --ownList "5854236464" --theirList "15702811262" null trade sent F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247 throw new Error("Must be logged in before trying to do anything with confirmations"); ^ Error: Must be logged in before trying to do anything with confirmations at request (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247:9) at SteamCommunity.getConfirmations (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:17:2) at doConfirmation (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:182:8) at F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:170:4 at IncomingMessage.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\node_modules\steam-totp\index.js:129:4) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1103:12) at process._tickCallback (internal/process/next_tick.js:63:19) F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl "https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-" --ownList "5854236464" --theirList "15702811262" F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:46 console.log(self.client.steamID); ^ TypeError: Cannot read property 'client' of null at Object.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:46:18) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\bot.js:3:18) at Module._compile (internal/modules/cjs/loader.js:689:30) F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl "https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-" --ownList "5854236464" --theirList "15702811262" SteamID { universe: 1, type: 1, instance: 1, accountid: 971243084 } trade sent F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247 throw new Error("Must be logged in before trying to do anything with confirmations"); ^ Error: Must be logged in before trying to do anything with confirmations at request (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247:9) at SteamCommunity.getConfirmations (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:17:2) at doConfirmation (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:182:8) at F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:170:4 at IncomingMessage.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\node_modules\steam-totp\index.js:129:4) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1103:12) at process._tickCallback (internal/process/next_tick.js:63:19) F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl "https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-" --ownList "5854236464" --theirList "15702811262" Promise { <pending> } trade sent F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247 throw new Error("Must be logged in before trying to do anything with confirmations"); ^ Error: Must be logged in before trying to do anything with confirmations at request (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:247:9) at SteamCommunity.getConfirmations (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:17:2) at doConfirmation (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:182:8) at F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\confirmations.js:170:4 at IncomingMessage.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\node_modules\steam-totp\index.js:129:4) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1103:12) at process._tickCallback (internal/process/next_tick.js:63:19) What should i do? The trade offer successfully sending , but cant accept automatically outgoing offer
  24. Hello there. I'm trying to do my own script but getting error always. Also "this.tradeUrl" consoling undefined. const SteamUser = require('steam-user'); const SteamCommunity = require('steamcommunity'); const SteamTotp = require('steam-totp'); const TradeManager = require('steam-tradeoffer-manager'); var self = null; var BotHandler = function(botConfig, tradeUrl, ownItems, theirItems) { this.tradeUrl = tradeUrl; console.log(this.tradeUrl) // this gives correct trade URL this.ownItems = ownItems; this.theirItems = theirItems; this.config = botConfig; this.client = new SteamUser(); this.manager = new TradeManager({ 'steam': this.client, 'domain': 'xx', 'language': 'tr' }); this.community = new SteamCommunity(); this.logOnOptions = { 'accountName': botConfig.username, 'password': botConfig.password, 'twoFactorCode': SteamTotp.getAuthCode(botConfig.secret) }; self = this; }; BotHandler.prototype.start = function() { this.client.on('webSession', this.trade); this.client.logOn(this.logOnOptions); }; BotHandler.prototype.trade = function(sessionId, cookies) { self.manager.setCookies(cookies, self.getInventory); }; BotHandler.prototype.getInventory = function(error) { if(error) { throw error; return; } self.manager.getInventoryContents(self.config.appId, self.config.contextId, true, self.createOffer); }; BotHandler.prototype.createOffer = function(error, inventory) { console.log('gg'); console.log(this.tradeUrl); // this gives "UNDEFINED" if(error) { throw error; return; } var offer = this.manager.createOffer(this.tradeUrl); for(var i = 0; i < self.ownItems.length; i++) { offer.addMyItem({ assetid: self.ownItems[i], appid: self.config.appId, contextid: self.config.contextId, amount: 1 }); } for(var i = 0; i < self.theirItems.length; i++) { offer.addTheirItem({ assetid: self.theirItems[i], appid: self.config.appId, contextid: self.config.contextId, amount: 1 }); } offer.send(); }; BotHandler.prototype.acceptTrade = function(error, status) { if(err) { throw error; return; } if(status == 'pending') { console.log("pending"); }else { console.log('sent'); } }; module.exports = BotHandler; What am i missing? Output Error var offer = this.manager.createOffer(tradeUrl); ^ TypeError: Cannot read property 'createOffer' of undefined at BotHandler.createOffer (F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56:27) at SteamCommunity.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\users.js:484:5) at Request._callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Gunzip.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13) at Gunzip.emit (events.js:194:15) F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl "https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-" --ownList 5854236464 --theirList 15702811262 https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw- undefined F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56 var offer = this.manager.createOffer(tradeUrl); ^ TypeError: Cannot read property 'createOffer' of undefined at BotHandler.createOffer (F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56:27) at SteamCommunity.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\users.js:484:5) at Request._callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Gunzip.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13) at Gunzip.emit (events.js:194:15) F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl "https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-" --ownList 5854236464 --theirList 15702811262 gg undefined F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56 var offer = this.manager.createOffer(this.tradeUrl); ^ TypeError: Cannot read property 'createOffer' of undefined at BotHandler.createOffer (F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56:27) at SteamCommunity.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\users.js:484:5) at Request._callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Gunzip.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13) at Gunzip.emit (events.js:194:15) F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl "https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-" --ownList 5854236464 --theirList 15702811262 gg undefined F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56 var offer = this.manager.createOffer(this.tradeUrl); ^ TypeError: Cannot read property 'createOffer' of undefined at BotHandler.createOffer (F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56:27) at SteamCommunity.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\users.js:484:5) at Request._callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Gunzip.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13) at Gunzip.emit (events.js:194:15) F:\Xamp\htdocs\steam-trade-bot> F:\Xamp\htdocs\steam-trade-bot> F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw- --ownList 5854236464 --theirList 15702811262 gg undefined F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56 var offer = this.manager.createOffer(this.tradeUrl); ^ TypeError: Cannot read property 'createOffer' of undefined at BotHandler.createOffer (F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56:27) at SteamCommunity.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\users.js:484:5) at Request._callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Gunzip.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13) at Gunzip.emit (events.js:194:15) 'token' is not recognized as an internal or external command, operable program or batch file. F:\Xamp\htdocs\steam-trade-bot>node bot.js --botId 0 --tradeUrl 'https://steamcommunity.com/tradeoffer/new/?partner=100331693&token=a6vNScw-' --ownList 5854236464 --theirList 15702811262 gg undefined F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56 var offer = this.manager.createOffer(this.tradeUrl); ^ TypeError: Cannot read property 'createOffer' of undefined at BotHandler.createOffer (F:\Xamp\htdocs\steam-trade-bot\BotHandler.js:56:27) at SteamCommunity.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\users.js:484:5) at Request._callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13) at Gunzip.<anonymous> (F:\Xamp\htdocs\steam-trade-bot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:277:13) at Gunzip.emit (events.js:194:15) 'token' is not recognized as an internal or external command, operable program or batch file.
  25. I am looking to have an account accept certain incoming trades (donations), and handle them accordingly. My question is: how do I best keep track of trades/items currently held by Steam due to the sender not having a mobile authenticator? I want to act only when the trade goes through and my account receives the item(s). Do I keep track of when the trade is supposed to go through after 14 days and use getOffer() some time after that? Thanks.
×
×
  • Create New...