All Activity
- Yesterday
-
Probably does, but I wouldn't expect things to go smoothly if you try to use it.
- Last week
-
Does "send" method from steam-client still work, or is it outdated?
-
katleenwhite joined the community
-
Invalid input SteamID [object Object]
TheMaster replied to ggforces's topic in node-steam-tradeoffer-manager
brother in order to send the tradeoffer u need the trade link the assetid of the item u want to send and a message i srsly dont know y u are parsing steam if so many times ifu have the complete trade url just use that if the partner in the trade url is missing and u need it then parse thesteamid 64 to get the id32 assuming u have the trade token already The error is caused due to u are calling the send offer with the wrong data most likely the steamid mistake or wrong format as ur error says or calling it where u are not supposed to or with incomplete data try to console,log what data are u sending when u are calling the send offer method. -
Invalid input SteamID [object Object]
Dr. McKay replied to ggforces's topic in node-steam-tradeoffer-manager
Which line is triggering the error? -
ggforces started following Invalid input SteamID [object Object]
-
I'm getting the error "Invalid input SteamID [object Object]". I'm retrieving data from the database to handle multiple accounts, such as item prices and other information, without any issues. However, I cannot send a trade when I try to do so. The partnerSteamID in the database is in SteamID64 format, and the trade link is correct. Can anyone help? const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const TradeOfferManager = require('steam-tradeoffer-manager'); const SteamID = require('steamid'); const mysql = require('mysql2/promise'); const axios = require('axios'); const tunnel = require('tunnel'); const SteamCommunity = require('steamcommunity'); const community = new SteamCommunity(); const SsAccounts = { host: 'h', user: 'u', password: 'p', database: 'd' }; const SteamAccounts = { host: 'h', user: 'u', password: 'p', database: 'd' }; async function getAccounts() { try { const db1Connection = await mysql.createConnection(SsAccounts); const [rows] = await db1Connection.execute("SELECT username, tradelink, partnerSteamID FROM users WHERE SSMmember = 'FA'"); const users = rows.map(row => ({ username: row.username, tradelink: row.tradelink, partnerSteamID: row.partnerSteamID })); await db1Connection.end(); if (users.length === 0) { console.log('Kriterlere uyan kullanıcı yok.'); return []; } users.forEach(user => { console.log(`Username: ${user.username}, TradeLink: ${user.tradelink}, PartnerSteamID: ${user.partnerSteamID}`); }); const db2Connection = await mysql.createConnection(SteamAccounts); const validAccounts = []; for (let user of users) { try { const [tables] = await db2Connection.execute(`SHOW TABLES LIKE '${user.username}'`); if (tables.length > 0) { const [accounts] = await db2Connection.execute(`SELECT username, password, shared_secret, proxyip, proxyid, identity_secret FROM ${user.username}`); accounts.forEach(account => { if (account.shared_secret && account.shared_secret.trim() !== '') { validAccounts.push({ ...account, tableName: user.username, tradelink: user.tradelink, partnerSteamID: user.partnerSteamID }); } }); } } catch (err) { console.error(`[${user.username}] Kullanıcı için veri alınırken hata oluştu:`, err); } } await db2Connection.end(); validAccounts.sort((a, b) => a.username.localeCompare(b.username)); return validAccounts; } catch (error) { console.error('Hata:', error); return []; } } async function getApiKey(cookies, proxyUrl) { try { const [proxyUser, proxyPass] = proxyUrl.match(/\/\/(.+):(.+)@/).slice(1, 3); const proxyHostPort = proxyUrl.split('@')[1]; const [proxyHost, proxyPort] = proxyHostPort.split(':'); const agent = tunnel.httpsOverHttp({ proxy: { host: proxyHost, port: parseInt(proxyPort), proxyAuth: `${proxyUser}:${proxyPass}` } }); const response = await axios.get('https://steamcommunity.com/dev/apikey', { headers: { Cookie: cookies.join('; ') }, httpsAgent: agent, maxRedirects: 5 }); const apiKeyMatch = response.data.match(/<p>Key: ([A-Z0-9]{32})<\/p>/); if (apiKeyMatch) { return apiKeyMatch[1]; } } catch (error) { if (error.response && error.response.status === 429) { console.log('API anahtarı alınırken 429 hatası: Too Many Requests'); } else { console.error('API anahtarı alınırken hata oluştu:', error); } } return null; } async function getMarketPrice(marketHashName) { try { const response = await axios.get(`https://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=${encodeURIComponent(marketHashName)}`); if (response.data && response.data.success) { return parseFloat(response.data.lowest_price.replace('$', '').replace(',', '')) || 0; } } catch (error) { console.error(`Fiyat bilgisi alınırken hata oluştu: ${marketHashName}`, error); } return 0; } async function updateAccountInfo(tableName, username, itemCount, totalPrice) { try { const db2Connection = await mysql.createConnection(SteamAccounts); await db2Connection.execute(`UPDATE ${tableName} SET stitemcount = ?, stitemprice = ? WHERE username = ?`, [itemCount, totalPrice, username]); await db2Connection.end(); console.log(`[${username}] Envanter bilgileri güncellendi: Item Sayısı = ${itemCount}, Toplam Fiyat = ${totalPrice}`); } catch (error) { console.error(`[${username}] Envanter bilgileri güncellenirken hata oluştu:`, error); } } async function parseTradeLink(tradeLink) { const url = new URL(tradeLink.trim()); const token = url.searchParams.get('token'); const partner = url.searchParams.get('partner'); if (!partner || !token) { throw new Error("Invalid Trade Link"); } return { partnerSteamID: new SteamID(`[U:1:${partner}]`).getSteamID64(), token }; } async function sendTradeOffer(account, items, partnerSteamID, token) { return new Promise((resolve, reject) => { const proxyUrl = `http://${account.proxyid}@${account.proxyip}`; const agent = tunnel.httpsOverHttp({ proxy: { host: account.proxyip.split(':')[0], port: parseInt(account.proxyip.split(':')[1]), proxyAuth: `${account.proxyid}` } }); const manager = new TradeOfferManager({ steam: new SteamUser(), domain: 'example.com', language: 'en', proxy: proxyUrl }); console.log(`[${account.username}] Partner SteamID: ${partnerSteamID}`); let steamID; try { steamID = new SteamID(partnerSteamID); } catch (error) { console.error(`[${account.username}] Invalid SteamID format: ${partnerSteamID}`, error); reject(error); return; } const offer = manager.createOffer({ partner: steamID, accessToken: token }); items.forEach(item => offer.addMyItem(item)); offer.send(async (err, status) => { if (err) { console.error(`[${account.username}] Trade offer gönderilirken hata oluştu:`, err); reject(err); return; } console.log(`[${account.username}] Trade offer gönderildi: ${status}`); resolve(offer.id); }); }); } async function confirmTradeOffer(account, offerId) { return new Promise((resolve, reject) => { const proxyUrl = `http://${account.proxyid}@${account.proxyip}`; const agent = tunnel.httpsOverHttp({ proxy: { host: account.proxyip.split(':')[0], port: parseInt(account.proxyip.split(':')[1]), proxyAuth: `${account.proxyid}` } }); community.getConfirmations(account.identity_secret, (err, confirmations) => { if (err) { console.error(`[${account.username}] Onaylar alınırken hata oluştu:`, err); reject(err); return; } const offerConf = confirmations.find(conf => conf.creator === offerId); if (!offerConf) { console.error(`[${account.username}] İlgili onay bulunamadı: ${offerId}`); reject(new Error('İlgili onay bulunamadı')); return; } community.acceptConfirmationForObject(account.identity_secret, offerConf.id, { proxy: agent }, (err) => { if (err) { console.error(`[${account.username}] Trade offer onaylanırken hata oluştu:`, err); reject(err); return; } console.log(`[${account.username}] Trade offer onaylandı: ${offerId}`); resolve(); }); }); }); } async function loginAndFetchInventory(account) { return new Promise((resolve) => { const client = new SteamUser(); const proxyUrl = `http://${account.proxyid}@${account.proxyip}`; const manager = new TradeOfferManager({ steam: client, domain: 'example.com', language: 'en', httpProxy: proxyUrl }); const guardCode = SteamTotp.generateAuthCode(account.shared_secret); const logOnOptions = { accountName: account.username, password: account.password, twoFactorCode: guardCode, httpProxy: proxyUrl }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log(`[${account.username}] Başarıyla giriş yapıldı`); client.setPersona(SteamUser.EPersonaState.Online); }); client.on('webSession', async (sessionID, cookies) => { console.log(`[${account.username}] Cookies:`, cookies); const apiKey = await getApiKey(cookies, proxyUrl); console.log(`[${account.username}] API Key: ${apiKey}`); if (apiKey) { const agent = tunnel.httpsOverHttp({ proxy: { host: account.proxyip.split(':')[0], port: parseInt(account.proxyip.split(':')[1]), proxyAuth: `${account.proxyid}` } }); manager.setCookies(cookies, async (err) => { if (err) { console.log(`[${account.username}] TradeOfferManager cookies set error:`, err); resolve(); return; } console.log(`[${account.username}] Cookies set for TradeOfferManager`); manager.apiKey = apiKey; // Set the API key const appId = 730; const contextId = 2; const fetchInventory = async (retryCount = 0) => { if (retryCount >= 3) { console.log(`[${account.username}] Envanter alınamadı, maksimum deneme sayısına ulaşıldı.`); resolve(); return; } manager.getUserInventoryContents(client.steamID, appId, contextId, true, async (err, inventory) => { if (err) { if (err.message.includes('403') || err.message.includes('500')) { console.log(`[${account.username}] Envanter alınırken hata oluştu, ${retryCount + 1}. yeniden deneme:`, err); await new Promise(res => setTimeout(res, 2000)); // 2 saniye bekleme süresi await fetchInventory(retryCount + 1); } else { console.error(`[${account.username}] Envanter alınırken hata oluştu:`, err); resolve(); } return; } const items = inventory.map(item => ({ assetid: item.id, appid: item.appid, contextid: item.contextid, amount: item.amount })); const { partnerSteamID, token } = await parseTradeLink(account.tradelink); try { const offerId = await sendTradeOffer(account, items, partnerSteamID, token); await confirmTradeOffer(account, offerId); } catch (err) { console.error(`[${account.username}] Trade offer gönderilirken veya onaylanırken hata oluştu:`, err); } let itemCount = inventory.length; let totalPrice = 0; for (let item of inventory) { let marketPrice = await getMarketPrice(item.market_hash_name); totalPrice += marketPrice; } await updateAccountInfo(account.tableName, account.username, itemCount, totalPrice.toFixed(2)); resolve(); }); }; await fetchInventory(); }, { proxy: agent }); community.setCookies(cookies, { proxy: agent }); } else { console.log(`[${account.username}] API anahtarı alınamadı.`); resolve(); } }); client.on('error', (err) => { console.error(`[${account.username}] Giriş yapılırken hata oluştu:`, err); resolve(); }); }); } (async () => { const accounts = await getAccounts(); for (let account of accounts) { await loginAndFetchInventory(account); } console.log('Tüm işlemler tamamlandı.'); })();
-
八百万 joined the community
- Earlier
-
TypeError: Cannot read property 'isValid' of undefined
rahimi0151 replied to Verize's topic in node-steam-tradeoffer-manager
this happed to me right now. thanks for this question. i helped me a lot ❤️ -
How can I send a picture with sendFriendMessage()?
sanchoys replied to sanchoys's topic in node-steam-user
I tried sending a message with BBcode as described in the documentation, but I'm getting the wrong display. const messageTest = '[img src="https://giphy.com/gifs/test-gw3IWyGkC0rsazTi" thumbnail_src="https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif" height="199" width="265" giphy_search="test" title="test GIF"][url=https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif]https://media0.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif[/url][/img]'; console.log(messageTest) const result = await user.chat.sendFriendMessage(steamId, messageTest); console.log(result) -
How can I send a picture with sendFriendMessage() method?
-
country is ID The actual balance is 22,517,929.24 After logging in, a wallet event was triggered, and it's showing an incorrect balance of -20431743.72 Could anyone help me understand what might be going wrong and guide me on how to fix it?
-
TheMaster started following Exchange only with APIKEY and TradeLink
-
Exchange only with APIKEY and TradeLink
TheMaster replied to pedroflores's topic in node-steam-tradeoffer-manager
u are saying without login and pass then u are saying by logging in the site how u login ? -
pedroflores reacted to a post in a topic: Exchange only with APIKEY and TradeLink
-
Exchange only with APIKEY and TradeLink
Dr. McKay replied to pedroflores's topic in node-steam-tradeoffer-manager
Can't be done. -
pedroflores joined the community
-
Hello, I would like to know if there is a way to do it like the site buff 163 does, where you provide your APIKEY and your TradeLink, and it automatically makes trades between players, but without requiring login and password, only by logging into the site and providing the APIKEY and the TradeLink, please.
-
sanchoys reacted to a post in a topic: I get an error when using the method getInviteLinkInfo()
-
I get an error when using the method getInviteLinkInfo()
Dr. McKay replied to sanchoys's topic in node-steam-user
Fixed in 5.0.10 -
Fixed app crash when calling getInviteLinkInfo if user_chat_group_state is null Full Changelog: v5.0.9...v5.0.10 View on GitHub
-
user.on('loggedOn', async () => { console.log('success login'); const linkInfo = await user.chat.getInviteLinkInfo("https://s.team/chat/jpfCmJfF"); console.log(linkInfo); })
-
Is there any library to craft all badges with steam trading cards to increase Steam level?
-
Yep, it's a system befitting Valve. You log in by passing a refresh token in the field named access_token, because of course you do.
-
Dr. McKay reacted to a post in a topic: Sentry file replacement
-
thank you
-
behzadpp reacted to a post in a topic: Error: getaddrinfo ENOTFOUN
-
steamcommunity.com's DNS records appear to have been wiped, preventing you from loading Steam Community (unless you have a cached DNS entry!). This was temporary and is now fixed
-
Nevermind, login is done by using refresh token instead of access token lol.
-
hello today my bot show me this Error and offline . help me for fix this Error . ty Error: getaddrinfo ENOTFOUN how can i fix this
-
I'm assuming you need to have a valid steam client session (of the same user) to call Authentication.GenerateAccessTokenForApp#1 to update access / refresh token. This would mean that if the program dies and fails to update the access token before it expires (access token is valid for a day), you would have to log in with username and password + oauth / 2fa to use the refresh token again.
-
Trade-offer-manager : manager.on 'newOffer' is not working
Metroo replied to Metroo's topic in node-steam-tradeoffer-manager
ok ill try it sir thx for replay ❤️ -
hello everyone ! im trying to make bot which reading incoming offers data and outputing them in console but my code is not working i dont understand why when i run the code the output is cookies set then im sending the trade to bot account but nothing happends const steamUser = require('steam-user') const steamtotp = require('steam-totp') const steamcommunity = require('steamcommunity') const steamTradeofferManager = require('steam-tradeoffer-manager') const config = require('./config') const account = new steamUser() const community = new steamcommunity() const manager = new steamTradeofferManager({ steam : account, community : community, language : 'en', pollInterval : 5000 }) const loginops = { //username accountName : config.account1.username, //password password : config.account1.password, //shared secret twoFactorCode : steamtotp.generateAuthCode(config.account1.shared_secret) } account.logOn(loginops) account.on('loggedOn', () => { account.setPersona(steamUser.EPersonaState.Online) account.gamesPlayed(730) }) account.on('webSession', (sid,cookies) => { manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); // Fatal error return; } console.log("Cookies set"); }); community.setCookies(cookies); }) manager.on('newOffer', function(offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID()); offer.accept(function(err, status) { if (err) { console.log("Unable to accept offer: " + err.message); } else { console.log("Offer accepted: " + status); if (status == "pending") { community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log("Can't confirm trade offer: " + err.message); } else { console.log("Trade offer " + offer.id + " confirmed"); } }); } } }); });