Jump to content
McKay Development

Search the Community

Showing results for tags 'Question'.

  • 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 mates! This might be a weird question, but I'm having trouble getting "client.getPersonas" to function in a module.export. Here is my file my problem is located in: (Problem is in the exports.GetSteamName) var exports = module.exports = {}; var SteamUser = require('steam-user'); var client = new SteamUser(); const SteamRepAPI = require('steamrep'); exports.CheckRep = function (SteamId64) { return new Promise(resolve => { SteamRepAPI.isScammer(SteamId64, function (err, result) { if (err) { console.log("Error Checking SteamREP for " + SteamId64); resolve(true); // true == Not a scammer } else { if (result) { console.log("eww thats gross") resolve(false); } else { console.log("Got Not-Scammer!") resolve(true); // true == Not a scammer } } }); }) } exports.GetSteamName = function (SteamID) { return new Promise(resolve => { client.getPersonas([SteamID], function (personas) { persona = personas[SteamID.getSteamID64()]; name = persona ? persona.player_name : ("[" + SteamID.getSteamID64() + "]"); resolve(name) }) }) } What happens is once the program gets to"client.getPersonas([steamID], function (personas) {" , it seems to run over everything inside of the function(personas). Including the "resolve" If I were to change exports.GetSteamName to: exports.GetSteamName = function (SteamID) { return new Promise(resolve => { client.getPersonas([SteamID], function (personas) { persona = personas[SteamID.getSteamID64()]; name = persona ? persona.player_name : ("[" + SteamID.getSteamID64() + "]"); resolve(name) }) console.log("Fired?") }) } I will get back "Fired?" in console. The problem is present in another file I am using for Chat messages.The problem is not present in "CheckRep". This could just be me not understanding how module.exports works exactly as this is still a somewhat new concept for me.CheckRep, however, works as expected and that's what I'm getting caught up on. I think it could be that "SteamUser" and "client" are being called more than expected (I'm declaring them in multiple files).SteamRepAPI is only declared in this file. I have resorted to moving the function into the main file, which works as expected. I would greatly prefer it to function in this file. Taken from package.json:"steam-user": "^3.28.2", Any help is greatly appreciated, Thanks!
  2. Hello My BoT is in a couple group chat rooms and is catching all messages starting with "!" in order to execute commands. I have an issue every time someone joins the chat room and Steam displays this: BoT returns: UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startsWith' of null I thought that "messages" and server_messages were 2 different items, so why the error when my code is: function parseMessage(groupID, chatID, message, senderID, senderAccountID, sender) { if (message && !message.startsWith('!')) { return; } Isn't the "joined" stuff a server message? How do I get rid of the error? Thanks as always
  3. I'm trying to login using node-steam-user with accountName and loginKey I have arround 20 accs. 90% of them throw Error: InvalidPassword and only few may be 'Logged into Steam'. But after each login I save new loginKey. What is a problem there? Is there a way to login at steam account again after server restarts? (without 2fa)
  4. Hi Even though my BoT is addressing me with "@roughnecks" in group chat, I don't get highlighted. Any way to make this work? Thanks
  5. Hello. I'm trying to join a group of mine but I have issues with IDs. If I use <groupID64>number</groupID64> - taken from my group url after adding "/memberslistxml?xml=1" - in "chat.getClanChatGroupInfo" I get info about a group which isn't mine. Then if I try to join my group, either by using groupID64 or groupID I can read while editing my group on Steam ( http://i.imgur.com/zCUqOcd.png ) i get an eresult 10 (Busy). Can you clarify which ID is which and how do I get them? Thanks
  6. 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.
  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. 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
  9. 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
  10. 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?
  11. 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?
  12. Hello, why sometimes my response ( { response: {} } ) is empty? Profile status and game are public.
  13. Hello. Can anyone make a code example on how to join a group chat, default "Home" channel?
  14. 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.
  15. 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
  16. 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
  17. 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.
  18. I noticed after searching around that steam-user doesn't have a Typescript definition for Visual Studio Code, will it stay like that or will we have one in the future ?
  19. Hello, It's possible to get profile information from steam-user object? I mean information like that: {"response":{"game_count":1,"games":[{"appid":730,"name":"Counter-Strike: Global Offensive","playtime_forever":224,"img_icon_url":"69f7ebe2735c366c65c0b33dae00e12dc40edbe4","img_logo_url":"d0595ff02f5c79fd19b06f4d6165c3fda2372820","has_community_visible_stats":true}]}} {"response":{"players":{"player":[{ "steamid": "xxxxxxxxxxxx", "communityvisibilitystate": 3, "profilestate": 1, "personaname": "xxxxxxxxxx", "lastlogoff": 1xxxxxxx, "profileurl": "https://steamcommunity.com/profiles/xxxxxxx/", "avatar": "xxxxxxxxxxxxxxxxxx", "avatarmedium": "xx", "avatarfull": "x", "personastate": 0, "primaryclanid": "xxxxxxxxxxxxxxxx", "timecreated": xxxxxxxxxxxxxxxxxx, "personastateflags": 0 } ]}}} It's possible to get it from steamcommunity/steam-user if my profile is private? It's possible to change profile status from private on public - download information about accounts and set accounts as private ? Sorry for stupid questions...
  20. Hello, I just started building my steam level up bot and couldn't code it when someone adding him to tell 'Hello, "Persona Name" Thank you for adding me'. this is the code i put it from another question but its sending 'Hello, [steamID] Thank you for adding me'. client.getPersonas([steamID], function(personas) { var persona = personas[steamID.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamID.getSteamID64() + "]"); }); client.chatMessage(steamID, 'Hi ' + name + ' Thank you for adding me!'); } });
  21. Hey, iam work on new functions for my BOT. I am currently working on boosting my main account via chat message to my BOT. The login works fine, but the logout does not work and I can't find the error Here my Code: // Boost Owners Account START else if (MSG.toUpperCase().indexOf("!STARTBOOST") >= 0) { let BoostClient = new SteamUser(), BoostManager = new TradeOfferManager({ "steam": BoostClient, "pollInterval": "10000", "cancelTime": "1800000" // 30m in ms }), BoostCommunity = new SteamCommunity(); let BoostLogOnOptions = { accountName: CONFIG.Boost.USERNAME, password: CONFIG.Boost.PASSWORD, twoFactorCode: SteamTotp.generateAuthCode(CONFIG.Boost.SHAREDSECRET) }; BoostClient.logOn(BoostLogOnOptions); BoostClient.on("loggedOn", function() { BoostClient.getPersonas([BoostClient.steamID], (personas) => { sleep(500); console.log("[Boost Steam Account] - Login successfully!"); client.chatMessage(SENDER, "[Boost Steam Account] - Login successfully!"); BoostClient.setPersona(SteamUser.Steam.EPersonaState.Online); BoostClient.gamesPlayed(730); }); }); BoostClient.on('webSession', (sessionid, cookies) => { BoostManager.setCookies(cookies); BoostCommunity.setCookies(cookies); sleep(2000); console.log("[Boost Steam Account] - Cookies set successfully"); client.chatMessage(SENDER, "[Boost Steam Account] - Cookies set successfully"); }); sleep(7000); console.log("[Boost Steam Account] - Boosting Games Active"); client.chatMessage(SENDER, "[Boost Steam Account] - Start Boosting Games"); } else if (MSG.toUpperCase().indexOf("!STOPBOOST") >= 0) { let BoostClient = new SteamUser(); BoostClient.logOff(); sleep(1000); console.log("[Boost Steam Account] - Stop Boosting Games"); client.chatMessage(SENDER, "[Boost Steam Account] - Stop Boosting Games"); } // Boost Owners Account END It runs not in an error, but i dont log off :-((( I hope someone can help me out... THX
  22. I've tried sending all my friends a message. so i made a function for that: function messageAllCommand() { var messageAll = readlineSync.question('Enter message: '); for (var friend in client.myFriends) { console.log(friend); client.chatMessage(friend, messageAll); } }but somewhy, it seems really random who gets the message tho it prints everyone's id it but still don't send everyone the message. here are the ID's: https://pastebin.com/5NGqV340 E.G: it printed the user id: 76561198278317090 but didn't sent the message. and it printed the user id: 76561198173748582 this time it sent the message. I checked and friendsList was emitted before BTW this forum is real good and i get answers.
  23. I would like it to accept everyone who added me when the bot wasn't opened. i've tried to do that but i think i didn't get how it works, here's what i tried: client.on('loggedOn', () => { client.setPersona(1); client.getPersonas(client.myFriends); }); client.on('user', function (sid, user) { console.log(sid + " " + user.value); if (user.value == 2) { client.addFriend(sid); client.getChatHistory(sid); } });
  24. 1. Is there a way to invite people to a steam lobby? (not chat one). the one that emits the 'lobbyInvite' ID event... 2. the 'friendOrChatMessage' ID event emit also when i write a message in a chat. how can i detect whether it is me or not, because the senderID isn't my id even if i write the message (in dm's only). the senderID it is the friend whom i wrote to... (maybe it's a bug so idk). 3. Is there any way to wait for a user input in the console while executing other functions that run on the same js file?
  25. How can i loop the sender message, so that i can wait for the response of the option to be selected which was printed by the for loop Kindly View the Attached Images for an clear example: Image of the example client.on("friendMessage", (SENDER, MSG) => { ... ... else{ var countList = 1; for(var i = 0; i < listOfProducts.length; ++i){ if(listOfProducts[i].is_free_license == false){ client.chatMessage(SENDER, countList +". "+listOfProducts[i].option_text) ountList++; } else{ client.chatMessage(SENDER, result[0].name + ", Unfortunately you can not buy this game as a gift.") } } console.log(countList); client.on("friendMessage", (SENDER, MSG) => { countList = countList - 1; if (MSG === 1) { client.chatMessage(" has been added to the Cart.") } }); } ... ... }); Kindly drop your suggestions... and thank you for your precious time.
×
×
  • Create New...