Ok so I have a code from a steam bot the accepts and declines trades if the offer state is correct. But I would like it to accept trade offers that give me things but decline trade offers that are made by someone else asking for things.
if(body.response.trade_offers_received){
body.response.trade_offers_received.forEach(function(offer) {
if (offer.trade_offer_state == 2){
offers.acceptOffer({tradeOfferId: offer.tradeofferid});
}
else {
offers.declineOffer({tradeOfferId: offer.tradeofferid});
}
}
);
}