SENPAY98K Posted June 15, 2021 Report Posted June 15, 2021 How do we add 1 gem to trade offer? If we request steam inventory we get the whole inventory, so is there a way to add only 1 gem ? Quote
Dr. McKay Posted June 16, 2021 Report Posted June 16, 2021 You need to filter the inventory to find the "Gems" item, and set its amount property to 1. Quote
Jack Nolddor Posted June 24, 2021 Report Posted June 24, 2021 Inventory is an array of items, you can use .filter() over the collection to keep just the item(s) you need. An excerpt from my bot code: static isGems(item) { return '753-Gems' === item.market_hash_name; } static isSackOfGems(item) { return '753-Sack of Gems' === item.market_hash_name; } Then, just use the .amount property to decide how many items you want to add to the trade for those which are stackeable like gems or sack of gems. Quote
SENPAY98K Posted June 24, 2021 Author Report Posted June 24, 2021 3 hours ago, Jack Nolddor said: Inventory is an array of items, you can use .filter() over the collection to keep just the item(s) you need. An excerpt from my bot code: static isGems(item) { return '753-Gems' === item.market_hash_name; } static isSackOfGems(item) { return '753-Sack of Gems' === item.market_hash_name; } Then, just use the .amount property to decide how many items you want to add to the trade for those which are stackeable like gems or sack of gems. I already found how to do it with context-id-amount. Thanks tho :) Quote
Recommended Posts
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.