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. Hi. I was trying to get group's members list by calling "getGroups" and I was expecting to have A Chat Room Group State object in response, which in turn should contain members - An array of Chat Room Member but all I got was "User Chat Room Group State". group_state: { user_chat_room_state: [Array], chat_group_id: '4817935', time_joined: 2019-03-12T22:26:00.000Z, desktop_notification_level: 0, mobile_notification_level: 0, time_last_group_ack: 2019-05-01T12:09:46.000Z, unread_indicator_muted: false } } ] So, I just don't know but something is wrong here. If it's the DOC wrong, how am I supposed to get members list apart from "joinGroup"? Thanks as always.
  2. Hey, so I have 2 bots trading items back to back Bot #1 takes 30 seconds to confirm a trade while Bot #2 takes 5 seconds What I want to happen is to minimize the time it takes to accept trades on Bot #1 Here's my constructor let client = new SteamUser(), manager = new TradeOfferManager({ "language": 'en', "steam": client, "pollInterval": "5000", "cancelTime": "1800000" }), community = new SteamCommunity(); // Bot #2 let client2 = new SteamUser(), manager2 = new TradeOfferManager({ "language": 'en', "steam": client2, "pollInterval": "5000", "cancelTime": "1800000" }), community2 = new SteamCommunity(); Any Ideas why the difference is so high between these 2 bots? They're pretty much using the same code across the script Also pollInterval is 5s in both.. Also for question #2: Is it okay to use this event for confirmations? community.on("newConfirmation", (CONF) => { community.acceptConfirmationForObject(CONFIG.Bot1.IDENTITYSECRET, CONF.id, (ERR) => { if (ERR) { console.log("## An error occurred while accepting confirmation: " + ERR); } }); });
  3. The line that the error pops up : manager.getUserInventoryContents('76561198083528564', 440, 2, true, function (error, inventory) { console.log(inventory.length); for(let l = 0 ; l < inventory.length; l++) { if(inventory[l].market_hash_name == prices[i].name) itemid = inventory[l].assetid; } }) Error:
  4. Hi, in my bot.config I have a masterclangroup ID64 set up so that my bot can join it. What I'd like to know is if it's necessary to have the bot joining at every boot and why? Secondly, is there a way to check if the bot has already joined my group and skip that process or is it unnecessary? Thanks
  5. 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!
  6. 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)
  7. 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
  8. Where can I read the documentation about client.changeEmail
  9. 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
  10. 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
  11. 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.
  12. 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.
  13. 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)
  14. 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?
  15. 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?
  16. 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.
  17. 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, ..., ....]);
  18. 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
  19. 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.
  20. 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?
  21. 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
  22. 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?
  23. 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?
  24. 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?
  25. It was implemented to Steam relatively recently. Is this something to expect in a future release, or did I completely overlook something? Thanks.
×
×
  • Create New...