Jump to content
McKay Development

Search the Community

Showing results for tags 'node-steam-user'.

  • 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. Hey! I am trying to add a feature for a client that requires retrive info of last trades made by bot. My question is: Anyone knows what is the rate limit of send a message to person? I didn't find anything in docs. I tried 100 ms of delay beetween each msg but still getting rate limit exceeded. Thanks in advance
  2. user.on('error', function(e) { log(username, "error: " + JSON.stringify(e)); log(username, e);}); Sometimes returns "{}" log:[y6p123] error: {}[y6p123] } Why?
  3. Is it possible to send image to friend with sendChatMessage? If yes which format it should be? Can i send a buffer?
  4. 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.
  5. 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
  6. 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!
  7. 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)
  8. 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
  9. Where can I read the documentation about client.changeEmail
  10. 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
  11. 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
  12. 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?
  13. 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, ..., ....]);
  14. 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
  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. Hello. Can anyone make a code example on how to join a group chat, default "Home" channel?
  17. 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 ?
  18. Hello, i bought proxies on luminati.io. But always getting 'HTTP CONNECT 403 Bad Port' error on logOn. My Code: let user = new SteamUser({ singleSentryfile: false, promptSteamGuardCode: false, dateDirectory: null, httpProxy: 'http://lum-customer-mycustomerid-zone-myzonename:mypassword@host:22225' }); user.logOn({ accountName: 'test', password: 'test', rememberPassword: true });Debug:
  19. So I am using steam-user to get a list of gameservers. My code worked for a while but when I tried to do it again on another script it just returns "null". I have tried everything I can think of and I am out of ideas. Anything to point me in the right direction would be greatly appreciated. const SteamUser = require('steam-user'); const client = new SteamUser(); client.logOn(); client.on('loggedOn', () => { console.log('Logged into Steam'); client.getServerList(null, 100, (servers) => { console.log(servers); }) });
  20. Hello logOn method not working. Stucked on "751" I try debugging and my logs =>
  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. Hi, I have a few questions: 1. How can i get RegionID of my account (that using in Steam Store). Reffering to this https://i.gyazo.com/93754ec9ef0032dbe38ce466b6d86974.png (is it right place?), my code is '62' but i want a country string like 'RU' or 'US'? Couldn't find any info in enums for that. 2. Is it possible to buy/buyAsGift games in Steam Store on US account from different GeoIP? Which pool of regions would be supported for gifting (GeoIP regions or account regions)? 3. And maybe somewhere exists a method to get that pool of supported regions for certain account (for buying games as gifts)? 4. Can i somehow catch an event when a recipient accept/decline a gift (from Steam Store, not from inventory)?
  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. Hello. I just updated npm modules and got steam-user 4.5 and my bot is still running fine (AFAIK). Is there a place where I can read about important changes made in v4.X which break v3.X code? I saw the announcements page here and releases on github but there's too many, so I was looking for some "shortcut" reading. Thanks
×
×
  • Create New...