Jump to content
McKay Development

Items names


Recommended Posts

Hi all! Newbie question, I've declared the language in the constructor, but I'm not getting any item name in the 'newOffer' event.

This is the rawJson I get from incoming offers

{
	"tradeofferid": "4514010558",
	"accountid_other": xxxxxxxx,
	"message": "test offer",
	"expiration_time": 1617915913,
	"trade_offer_state": 2,
	"items_to_receive": [
		{
			"appid": 753,
			"contextid": "6",
			"assetid": "16638623730",
			"classid": "2353210051",
			"instanceid": "0",
			"amount": "1",
			"missing": false,
			"est_usd": "4"
		},
		{
			"appid": 753,
			"contextid": "6",
			"assetid": "16638623732",
			"classid": "2217483072",
			"instanceid": "0",
			"amount": "1",
			"missing": false,
			"est_usd": "3"
		}
	],
	"is_our_offer": false,
	"time_created": 1616706313,
	"time_updated": 1616706315,
	"from_real_time_trade": false,
	"escrow_end_date": 0,
	"confirmation_method": 0
}

Any tips? ^_^

Link to comment
Share on other sites

Posted (edited)

Hi!, here you go

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

var steam = new SteamCommunity();
var client = new SteamUser({
	enablePicsCache: true,
	changelistUpdateInterval: 60000
});

var manager = new TradeOfferManager({
	steam: client,
	community: steam,
	language: `en`,
	globalAssetCache: true,
	savePollData: true,
	cancelTime: 60000,
	pendingCancelTime: 30000
});

 

I tried 'en' and 'es' as language. Also deleted node_modules folder and reinstalled all fresh but can't make it work. Thanks for the reply! ^_^

Edited by Nico31
Link to comment
Share on other sites

On 3/27/2021 at 12:21 AM, Dr. McKay said:

Use 'english' as the language.

Just tried that, no changes

		{
			"appid": 753,
			"contextid": "6",
			"assetid": "16658463991",
			"classid": "2353210051",
			"instanceid": "0",
			"amount": "1",
			"missing": false,
			"est_usd": "5"
		}

Would it make any difference if I delete the appdata folders?

Link to comment
Share on other sites

For debug purposes, I didn't know that.

I'm using this code to log offered items

log += `their items: ${offer.itemsToReceive.length} - `;
if (offer.itemsToReceive.length > 0) {
	for (var i = 0; i < offer.itemsToReceive.length; i++) {
		log += `\n	#${(i + 1)} - ${offer.itemsToReceive[i].name} | ${offer.itemsToReceive[i].type} | ${offer.itemsToReceive[i].market_hash_name}`;
	}
}

But always return undefined

	#1 - undefined | undefined | undefined
	#2 - undefined | undefined | undefined

It's very strange, I tried the same code earlier in my laptop and worked fine. I have no clue what could be wrong, I'm just guessing that could be a corrupted file, or some node issue

Link to comment
Share on other sites

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...
 Share

×
×
  • Create New...