Check if user has item in his inventory.
$ npm install --save steam-user-has-item
var hasItem = require('steam-user-has-item');
hasItem({user: 'awtt', item: '937246119_188530139'});
hasItem.then(item => {
console.log(item);
});
var hasItem = require('steam-user-has-item');
hasItem({user: 'awtt', item: '937246119_188530139', timeout: 500}); // Will retry every 500 miliseconds if user have the item
// Sometime in the future
hasItem.then(item => {
console.log(item);
});
hasItem.clear(); // Optionally you can clear the timeout if you dont want to wait any more
Return: Promise that resolve to item object if found or reject if item is not found
Type: String
Steam username or profile ID.
Type: String
Item ID from steam-user-inventory
Type: String
Default 730/2/
(csgo)
Steam game id.
Type: Number
Timeout in miliseconds to retry, promise will be resolved once user have the item. (if you know transaction will happen soon)
MIT © Daniel Husar