if (response.statusCode != 200) {
if (response.statusCode == 401) {
this.manager._notifySessionExpired(new Error("HTTP error 401"));
Helpers.makeAnError(new Error("Not Logged In"), callback);
return;
}
console.log(response.statusCode);
console.log(callback);
console.log(body);
Helpers.makeAnError(new Error("HTTP error " + response.statusCode), callback, body);
return;
}
500
[Function (anonymous)]
{
strError: 'An error occurred. Please see your Trade Offers page on Steam for information about changes to trading.'
}
This in send method from tradeoffer.js.
const SteamUser = require('steam-user');
const SteamCommunity = require('steamcommunity');
const TradeOfferManager = require('steam-tradeoffer-manager');
//
const community = new SteamCommunity();
const steamID = SteamCommunity.SteamID;
//===================INIT STEAM USER========================
const client = new SteamUser();
//===================INIT TRADE OFFER MANAGER========================
const manager = new TradeOfferManager({
steam: client,
domain: 'domain.com',
language: 'en'
});
client.logOn({
accountName: botConfig.username,
password: botConfig.password,
twoFactorCode: require('steam-totp').getAuthCode(botConfig.sharedSecret)
});
client.on('loggedOn', () => {
console.log(`Bot ${botConfig.username} logged in`);
const personaName = client.steamID.getSteamID64();
console.log(`Bot persona name: ${personaName}`);
});
client.on('webSession', (sessionid, cookies) => {
manager.setCookies(cookies, err => {
if (err) {
console.error(`Failed to set cookies for bot ${botConfig.username}:`, err);
process.exit(1);
}
community.setCookies(cookies);
community.startConfirmationChecker(30000, botConfig.sharedSecret);
console.log(`Bot ${botConfig.username} ready to trade`);
});
bot.manager.getUserInventoryContents(userSteamId, appid, contextid, true, (err, inventory) => {
if (err) {
console.log("Failed to get client user inventory:", err);
return;
}
if (inventory.length === 0) {
console.log("client user inventory is empty.");
return;
}
console.log(`take first item`);
const firstItem = inventory[0];
const offer = bot.manager.createOffer(userTradeUrl); //example https://steamcommunity.com/tradeoffer/new/?partner=xxx141&token=xxfacGs
offer.addTheirItem({
appid: appid,
contextid: contextid,
assetid: firstItem.assetid
});
offer.send((err, status) => {
if (err) {
console.error("Failed to send offer:", err);
console.error("Steam response:", err.cause || err.response || err.body);
return res.status(500).json({ success: false, message: 'Error sending trade offer', error: err.message });
}
console.log("Trade offer sent successfully! Status:", status);
});
});
Failed to send offer: Error: An error occurred. Please see your Trade Offers page on Steam for information about changes to trading.
Both accounts meet the requirements. All authorizations are successful.
I can go to tradeurl and send a trade manually. The only message I get after sending is that the trade will be delayed until 15 days due to not using steam guard for a long time (something like that).
steam response all err./ empty for this error
what is my mistake