Jump to content
McKay Development

Search the Community

Showing results for tags 'node-steam-tradeoffer-manager'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL




  1. Hi, I have the following code and am trying to check whether the app is able to log into steam or not. For whatever reason, the error is caught but the loggOn event never occurs Any ideas how to fix this? const client = new SteamUser();const logOnOptions = {accountName: req.body.username,password: req.body.password,twoFactorCode: req.body.tfa }; client.logOn(logOnOptions); client.on('loggedOn', () => {console.log('Hi!');}); client.on('error', () => {console.log('This is one dumb human')}); Any thoughts?
  2. Is there a way to cancel all outgoing trades when the bot starts? Thanks
  3. Hi, Is it possible to trigger the newOffer event when an offer is sent from the bot? It obviously triggers when an offer is recieved, but how can I make it (or another event) trigger upon sending an offer? Thanks
  4. const SteamUser = require('steam-user');const SteamTotp = require('steam-totp');const SteamCommunity = require('steamcommunity');const TradeOfferManager = require('steam-tradeoffer-manager'); const client = new SteamUser();const community = new SteamCommunity();const manager = new TradeOfferManager({ steam: client, community: community, language: 'en'}); const logInOptions = { accountName: "........", password: "...........", twoFactorCode: SteamTotp.generateAuthCode("............")}; client.logOn(logInOptions); client.on('loggedOn', () => { console.log('logged on');client.setPersona(SteamUser.EPersonaState.Online, "bot1");client.gamesPlayed(570);});client.on('webSession', (sid, cookies) => {console.log(cookies); manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, "............"); mytrade();}); manager.on('newOffer', offer => { console.log('offer detected'); if (offer.partner.getSteamID64() === '.............') { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(status); } }) } else { console.log('unknown sender'); offer.decline(err => { if (err) { console.log(err); } else { console.log('trade from stranger declined'); } }); }}); function mytrade() {manager.getOfferToken((err, token) => {if (err) {console.log("gsfgfasy", err)}else {var partner="id........"const offer = manager.createOffer('id.....',token);manager.getUserInventoryContents(partner,570, 2, true, (err, myInv) => {if (err) {console.log(err);} else {console.log("myenv",myInv[0]);// myInv.forEach(function(item) {offer.addTheirItem(myInv[0]);offer.setMessage('You received a floral shirt!');offer.send((err, status) => {if (err) {console.log(err);} else {console.log('trade sent');console.log(status);}}) // })}}) }})}
  5. Hey, is it possible to retrieve these values using the npm's on this forum? or will I need an API? Does any1 knows of any? thank you!
  6. Hey, I'm trying to retrieve the items im getting in trades, but problem is I can't do that when my language is removed from my client constructor let client = new SteamUser(), manager = new TradeOfferManager({ "steam": client, "pollInterval": "10000", "cancelTime": "1800000" }), Is there a work around? I had to remove language, and adding it back isn't an option
  7. Hey, so Im trying to get the market price of an item I receive on a trade. It works, but for some reason the script won't wait for my async function to finish and returns an empty result First I have this function which is triggered when I receive an offer for their items async function ProccessTradeOffer(offer){ let TheirItems = offer.itemsToReceive; const Deposited_Items = await ConvertToKeys2(TheirItems); console.log(Deposited_Items); // this will print null and won't wait for the async to finish } This is the other function im calling async function ConvertToKeys2(Items){ let ValueInKeys = []; // array of objects containing info about the items return new Promise(resolve => { setTimeout(() => { if(Market_Value > -1){ obj = { name: item_name, value: Market_Value } ValueInKeys.push(obj); } }, 2000); }); } } return ValueInKeys; } The problem is that in the main async function it'll not wait for my ConvertToKeys2 function to calculate & add it to array and simply print an empty array. It's an async function so I don't understand why thisis happening.. Thx for your help
  8. I try to create code that will convert steamtradematcher.com URL and send trade offer. steamtradematcher.com URL looks like: _ttps://www.steamtradematcher.com/action/startTradeOffer/239296914/2nqDtNKM/1935295573;2139754079/1930661303;2139726948From this line I get all the data: Partner, Token and Items. However, I think I'm doing something wrong. My method looks pretty complicated and doesn't work anyway.My question is how can I find the first any item with classid="1935295573" to add it to the trade later? (One item) // MSG = "STM https://www.steamtradematcher.com/action/startTradeOffer/239296914/2nqDtNKM/1935295573;2139754079/1930661303;2139726948" let stmUrl = MSG.split("/"), tradePartner = "[U:1:" + stmUrl[5] + "]", tradeToken = stmUrl[6], stmHisItems = stmUrl[8].split(";"), stmMyItems = stmUrl[7].split(";"); if (stmHisItems.length != stmMyItems.length) { console.log("ERROR 1: Bad url"); } else { let t = manager.createOffer(tradePartner, tradeToken); t.getUserDetails((ERR, ME, THEM) => { if (ERR) { console.log("ERROR 2: " + ERR); } else if (ME.escrowDays == 0 && THEM.escrowDays == 0) { let hisItems = [], myItems = []; manager.getUserInventoryContents(tradePartner, 753, 6, true, (ERR, INV, CURR) => { if (ERR) { console.log("ERROR 3: " + ERR); } else { INV = INV.filter((ITEM) => ITEM.getTag("item_class").internal_name == "item_class_2"); // <<<<<<<<<<<< for (let i = 0; i < INV.length; i++) { // <<<<<<<<<<<< for (let j = 0; j < stmHisItems.length; j++) { // <<<<<<<<<<<< if (stmHisItems[j] == INV[i].classid) { // <<<<<<<<<<<< hisItems.push(INV[i]); // <<<<<<<<<<<< console.log("PUSH:" + i); // <<<<<<<<<<<< stmHisItems[j] = "need_only_one."; // <<<<<<<<<<<< } } } // 2. find my items and 3. add his/my items in trade 4. send trade } }); } }); }
  9. Hi. I was thinking about creating a random, 1:1 trade bot; meaning that anyone can send an item to the bot and then the bot sends back another item of the same inventory type (e.g. a TF2 weapon for another TF2 weapon). First problem I see is that I should somehow differentiate between donations (my bot is currently set up to accept donations only) and a "lottery" type of trade (people sending an item but expecting something back). I thought maybe they could attach a message like "lottery" to their trade offer and the bot would know it's not a donation, so initiating an outgoing offer soon after, but I only found a "setMessage(message)" method, can't see any "getMessage". Is this achievable somehow? Anyone (with experience) can shed some light about the best course of actions? Thanks
  10. Hello, i have a question do anyone have idea how to make a diffrent texts after trade is accepted by person who write command i have in mind something line when buyer use !buytf > get offer > accept it > get a message with other bot who sell tf keys etc if he use !buycs he get message with bot who sell csgo keys and thats my question idk who to make it in 100% i know i can make 1 message if (TradeOfferManager.ETradeOfferState[OFFER.state] == 3) { client.chatMessage(OFFER.partner, " Thanks for trading with me!") }
  11. I've written some lines to check the user background but I don't know how to get all of the items I am receiving and giving. const requestReview = (offer) => { var user = offer.partner.getSteamID64(); for(i = 0; i < offer.itemsToGive.length; i++){ var giveItems = offer.itemsToGive[i].market_hash_name; } for(i = 0; i < offer.itemsToReceive.length; i++){ var receiveItems = offer.itemsToReceive[i].market_hash_name; } client.chatMessage(config.bossSteamID, "--------------------------------"); client.chatMessage(config.bossSteamID, "User "+user+" sent an offer above 14 keys in value. Requesting manual review..."); client.chatMessage(config.bossSteamID, "User Backpack.tf: https://backpack.tf/profiles/"+user); client.chatMessage(config.bossSteamID, "Item to receive: " + receiveItems); client.chatMessage(config.bossSteamID, "Item to give: " + giveItems); client.chatMessage(config.bossSteamID, "Offer ID"); client.chatMessage(config.bossSteamID, offer.id); client.chatMessage(config.bossSteamID, "--------------------------------"); backgroundCheck(offer); } Right now, it would only send me the last item in the trade offer and I would like to modify it to give me all the names in the trade offer. Also is there a way to make it so it can show (ie. 19x keys, 20x ref) instead of all items with just ( , ) separating them (like keys, keys,....)?
  12. Hey, so I'm trying to get user's personaName in a sent trade offer. I'm pretty sure I'm doing this right, but I can't figure out what's causing the error.. manager.on("sentOfferChanged", (OFFER, OLDSTATE) => { OFFER.getUserDetails((err, me, them) => { theirname = them.personaName; console.log(theirname); }); });
  13. C:\Users\lokin\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:255 throw new Error("Missing appid, contextid, or assetid parameter"); ^ Error: Missing appid, contextid, or assetid parameter at addItem (C:\Users\lokin\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:255:9) at TradeOffer.addMyItem (C:\Users\lokin\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:167:9) at C:\Users\lokin\OneDrive\New folder\bot.js:48:23 at SteamCommunity.<anonymous> (C:\Users\lokin\node_modules\steamcommunity\components\users.js:384:5) at Request._callback (C:\Users\lokin\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (C:\Users\lokin\node_modules\request\request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (C:\Users\lokin\node_modules\request\request.js:1161:10) at Request.emit (events.js:182:13) at Gunzip.<anonymous> (C:\Users\lokin\node_modules\request\request.js:1083:12) Error ^^ I found some examples of creating trade offers on steam but I don't quite understand how to do it. I would like to first differentiate the refined metal from the TF2 inventory and send a certain number (eg 5 refined metal) to the owner when it has more than 5 in its backpack. const SteamUser = require('steam-user'); const SteamCommunity = require('steamcommunity'); const SteamTotp = require('steam-totp'); const TradeOfferManager = require('steam-tradeoffer-manager'); const config = require('./config'); let client = new SteamUser(); let manager = new TradeOfferManager({ "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam "domain": "example.com", // Our domain is example.com "language": "en" // We want English item descriptions }); let community = new SteamCommunity(); // Steam logon options let logOnOptions = { "accountName": config.accountName, "password": config.password, "twoFactorCode": SteamTotp.getAuthCode(config.shared_secret) }; client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam"); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function() { manager.loadInventory(440, 2, true, function(err, inventory) { if (err) { console.log(err); return; } console.log("Found " + inventory.length + " Team Fortress 2 items"); console.log(inventory); var ref = 0; for (var i = 0; i < inventory.length; i++){ if(inventory[i].market_hash_name == 'Refined Metal'){ ref++ var metal = inventory[i].assetid; } } console.log(metal); if(ref >= 5){ //I want to send 5 metal when the bot backpack has enough metal in its backpack console.log('We have enough refined metal. Sending the trade'); let offer = manager.createOffer(config.bossID); offer.addMyItem(metal); offer.send(function(err, status) { if (err) { console.log(err); return; } if (status == 'pending') { console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject(config.identity_secret, offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); } }); } }); }); community.setCookies(cookies); });
  14. Hello fellas ... I'm trying to add a kind of "counter" to trades sent by my LevelUp BOT. I'm fairly lazy about programming, I do things on the basis of trial and error. The results, of course, are not always satisfactory. with the screenshots it will be easy to understand what I want. I tried use +conf.creator https://prnt.sc/mf6xbj but I realized trade offer not YET created and therefore, I would not get the result I want then I tried use: +offer.id https://prnt.sc/mf74ef and the result was null I don't want the result to necessarily be the token of the trade offer. I want there to have an accountant that changes according to the exchange offers that my bot sends.
  15. Hey. Can someone tell my why my code not gives any info on console? I only see "connected to steam" and nothing more, even if i send trade offer to this steam account. const SteamUser = require('steam-user'); const TradeOfferManager = require('steam-tradeoffer-manager'); const Bot = new SteamUser(); const TradesManager = new TradeOfferManager({steam: Bot, pollInterval: 1000, language: 'pl'}); Bot.logOn({ accountName: "<myaccountname>", password: "<mypassword>" }); Bot.on('loggedOn', () => { console.log("connected to setam"); Bot.setPersona(SteamUser.Steam.EPersonaState.Online); }); TradesManager.on('newOffer', Offer => { console.log("new offer detected"); }); TradesManager.on('unkownOfferSend', Offer => { console.log("new offer detected"); });
  16. Say I want to create an offer but need to add just Trading Cards to it, how do I select them? I already know about appid, contextid and "item_class_2" but I need a working example after I loaded my Inventory, which has 4 [Object] inside "tags": CEconItem { appid: 753, contextid: '6', assetid: '10305554518', classid: '1496965455', instanceid: '0', amount: 1, pos: 30, id: '10305554518', background_color: '', icon_url: 'IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEaiHLrVJRsl8vGuCUY7Cjc9ehDNVzDMCeHqtjCQrcex4NM6b8wT1tePGP3j2fSSCJizYG1s1RLtXYTzc9zSjsL-QQj6dE-wkEggGfvQA8GFPPZzbNhM_1YcK_GPhwwp3DhFucMpUdAqp9X0eMLoglXVEd59RmXWjJpDc1F5hYUA8W-2yBLzHbdLzlSYhCxtiGvEYMYOXsXDyuMmmfLGLLIM8gGfI', icon_url_large: 'IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEaiHLrVJRsl8vGuCUY7Cjc9ehDNVzDMCeHqtjCQrcex4NM6b8wT1tePGP3j2fSSCJizYG1s1RLtXYTzc9zSjsL-QQj6dE-wkEggGfvQA8GFPPZzbNhM_1YcK_GPhwwp3DhFucMpUdAqp9X0eMLoglXVEd59RmXWjJpDc1F5hYUA8W-2yBLzHbdLzlSYhCxtiGvEYMYOXsXDyuMmmfLGLLIM8gGfI', descriptions: [ [Object] ], tradable: true, owner_actions: [ [Object], [Object] ], name: 'Santa Claus', type: 'Solitaire Christmas. Match 2 Cards Trading Card', market_name: 'Santa Claus', market_hash_name: '428510-Santa Claus', market_fee_app: 428510, commodity: true, market_tradable_restriction: 7, market_marketable_restriction: 7, marketable: true, tags: [ [Object], [Object], [Object], [Object] ], is_currency: false, fraudwarnings: [] }, CEconItem {
  17. Hi, so I wrote a few codes to my bot to make it send me a message with offer id included once there's a need for the background check. But I don't know how or is there a way to make it accept the trade offer through providing the trade offer id to the bot. const parseAdminMessage = (message) =>{ if (message.substring(0,8) == '!accept '){ var offerid = message.substring(8); console.log(offerid); //It can show the correct offerid here but i dont know how to make it accept the trade by the offerid } //This is what I used to accept normal trade offer with the offer status const acceptTradeOffer = (offer) => { offer.accept(false, function(error, status) { if (error) { logger.error(`| OFFER RECEIVED |: ID#${offer.id} has failed trying to accept it. Reason: Offer is no longer valid.`); return 'Badass'; } else if (status === 'pending') { logger.info(`| OFFER NEEDS CONFIRM | : ID#${offer.id} is accepted but needs confirmation`); var confCount = 0; function confirm(idSecret, idOffer) { community.acceptConfirmationForObject(idSecret, idOffer, function(error) { confCount++ if (error) { if (confCount < 4) { confirm(idSecret, idOffer); } else { logger.error(error); logger.fail(`| OFFER RECEIVED | : ID#${offer.id} has failed trying to confirm it. Reason: Offer is no longer valid.`); return 'done'; } } else { return 'done'; } }); } confirm(config.identity_secret, offer.id); } else { return 'done'; } }); }
  18. I write the code so when the bot log on the account it gives me the info of the inventory ( I think i did that xd) manager.loadInventory(753, 3, true, (err, inventory) => {console.log(inventory);}) When i open the bot the console says loged onundefined Help ?
  19. I have problem: 2019-01-14T16:31:25.036Z - error: Error polling for trade offers: Error: socket hang up2019-01-14T18:31:43.234Z - error: Error polling for trade offers: Error: socket hang upMy server:- Ubuntu 14.04 Plesk (64bit)- I use nodejs server with express + ssl My suuport told me do this ( https://support.plesk.com/hc/en-us/articles/115002107425--HUB-503-Service-Unavailable-on-Plesk-server ). After i do this: (set Default site to none via Plesk: Tools & Settings>IP Addresses> your_IP_Address ).All this didn't help me, what i need do?
  20. Hello, I'm using Steam card bot, but lately I got weird problem with memory usage. Usually process using about 200MB RAM, but lately I got a lot of cards - about 100,000 and I did a lot of trades, my VPS is limited to 1GB memory, and my process going up to 1000MB+ and killing my VPS session.
  21. let client = new SteamUser(); community = new SteamCommunity({ "request": Request.defaults({"rejectUnauthorized": false}) }); manager = new TradeOfferManager({ steam: client, community: community, language:'en' }); if (config.autologin == 1) { client.logOn({ "accountName":config.username, "password":config.password, "twoFactorCode": SteamTotp.generateAuthCode(config.sharedse) }) } else { var rl = Readline.createInterface({ input: process.stdin, output: process.stdout }); rl.question("username: ", function(name) { var username = name; rl.question("password: ", function(pass) { var password = pass; client.logOn({ "accountName":config.username, "password":config.password, "twoFactorCode": SteamTotp.generateAuthCode(config.sharedse) }) }); }); } client.setOption('promptSteamGuardCode',true);//true代表手动输入令牌,false代表使用2FA文件 client.on('loggedOn',() => { console.log('\n### Logged into Steam\n## steamid64:'+client.steamID+'\n## play game:'+config.playgame+'\n## trademode:'+config.trade+'\n## invitmode:'+config.invite); client.setPersona(SteamUser.Steam.EPersonaState.Online); client.gamesPlayed(config.playgame); botid64 = client.steamID; botid3 = client.steamID.getSteam3RenderedID() }); client.on('webSession', function(sessionid, cookies) { manager.setCookies(cookies); community.setCookies(cookies); }); is there any possible i can accept the tradeoffer with out 2FA sharedse? in some reason, i lose my sharedse, i gave it for a tradesite, and it can help me to send skins to other peole, and i can get the code when i want to login. and i make this bot can accept the offer when he got a tradeoffer,it works Just after logging in, but After a while 30mins or 1hours he can't accept the offer any more, and it just show "Unable to accept offer: Not Logged In"
  22. community.acceptConfirmationForObject(identitySecret, offer.id, function(err) { if(err){ console.log(chalk.red("Confirmation Failed for " + offer.id + ": " + err)); } else { console.log(chalk.green("Offer " + offer.id + ": Confirmed!")); } }); How can I delay this ^ for a couple seconds, avoiding it being fired earlier than offer.accept (which is right before)? I know this is more a coding issue rather than module's issue but I'm beginning to code in js and this async stuff hurts Thanks
  23. Hello My bot is not running. I send an offer to it and then start it. Trade offer gets accepted but I get the error message "This trade offer is no longer valid." It's happening when retrieving UserDetails: if (offer.itemsToGive.length === 0) { offer.getUserDetails((err, me, them) => { if (typeof (them) !== 'undefined') { donator = them.personaName; console.log(`donator is: ${donator}`); } else { console.log(err); } }); because I'm not getting donator's name. This is my console.log: Error: This trade offer is no longer valid. at SteamCommunity._checkTradeError (D:\Portable\Birba\node_modules\steamcommunity\components\http.js:144:13) at Request._callback (D:\Portable\Birba\node_modules\steamcommunity\components\http.js:52:80) at Request.self.callback (D:\Portable\Birba\node_modules\request\request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (D:\Portable\Birba\node_modules\request\request.js:1161:10) at Request.emit (events.js:182:13) at Gunzip.<anonymous> (D:\Portable\Birba\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:273:13) at Gunzip.emit (events.js:187:15) at endReadableNT (_stream_readable.js:1094:12)Donation accepted. Status: accepted. Problem is, I'm posting a comment on bot's profile upon successful incoming donation and if there are offers BEFORE I run the bot, comments are not posted, since there's a check on "donator" and it doesn't return. BUT: If I keep the bot running and then send one more offer, it gets accepted and all is working fine without errors. donator is: roughnecks Donation accepted. Status: accepted. Comment Posted
  24. I'm not sure about steam-tradeoffer-manager, maybe my problem is related to steam-user.I always received the text of errors (ERR) in English. But after launching a third-party program, now i get them in another language. let client = new SteamUser(), manager = new TradeOfferManager({ "steam": client, "language": "en" }), community = new SteamCommunity(); //... let t = manager.createOffer(SID); t.getUserDetails((ERR, ME, THEM) => { if (ERR) { console.log("cant trade: " + ERR); // <<< not in English } else if (ME.escrowDays == 0 && THEM.escrowDays == 0) { console.log("all good"); } else { console.log("escrowDays"); } }); How can I return the language to English? (Global) And can I get errors in a specific language if need?
  25. Hi, it is possible to set API? Trade-offers: this.apiKey = null; this._community.getWebApiKey(this._domain, (err, key) => { if (err) { callback(err); return; } this.apiKey = key; callback(); }); I can make a pull request to change this.apiKey = (options.apiKey || null); Or there is a reason for not giving option to pass api key?
  • Create New...