Jump to content
McKay Development

Recommended Posts

Posted
const SteamUser = require('steam-user');
const SteamCommunity = require('steamcommunity');
const TradeOfferManager = require('steam-tradeoffer-manager');

let client = new SteamUser();
let community = new SteamCommunity();
let manager = new TradeOfferManager({steam: client, community: community, language: 'en'});

client.logOn({
accountName: '***',
password: '***!'
});

client.on('loggedOn', () => {
console.log('Logged into Steam');
});

client.on('webSession', (sessionID, cookies) => {
manager.setCookies(cookies);
community.setCookies(cookies);
community.startConfirmationChecker(10000, 'identity_secret');
});

client.on('webSession', function(sessionID, cookies) {
makeOffer(); //Make the trade offer after the bot has logged in successfully
});

function makeOffer() {
let tradeOffer = manager.createOffer('765611****04837');

let itemsToTrade = [
{appid: '570', contextid: '2', assetid: '16130757352'},
{appid: '570', contextid: '2', assetid: '18355191106'},
// ...add as many items as you want here
];

tradeOffer.addMyItems(itemsToTrade);

tradeOffer.setMessage('Here is the trade offer');

tradeOffer.send(function(err, status) {
if (err) {
console.log(err);
} else {
console.log(`Trade offer sent successfully. Status: ${status}.`);
}
});
}




this code gives me error :
Error: HTTP error 403
    at SteamCommunity.<anonymous> (C:\Users\Parsa Rasouli\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:349:24)
    at Request._callback (C:\Users\Parsa Rasouli\node_modules\steamcommunity\components\http.js:67:15)
    at self.callback (C:\Users\Parsa Rasouli\node_modules\request\request.js:185:22)
    at Request.emit (node:events:513:28)
    at Request.<anonymous> (C:\Users\Parsa Rasouli\node_modules\request\request.js:1154:10)
    at Request.emit (node:events:513:28)
    at Gunzip.<anonymous> (C:\Users\Parsa Rasouli\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (node:events:627:28)
    at Gunzip.emit (node:events:513:28)
    at endReadableNT (node:internal/streams/readable:1359:12)

 
Posted
On 12/31/2023 at 10:15 AM, Dr. McKay said:

You're probably getting IP rate limited.

Hey man tnx for answering 

Is my code fine? 

Do you have any example code to send a trade offer to user? 

Also one question manage create offer 

I must put steam id 64 or 32? And how to put trade link instead of that? 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...